samedi 21 décembre 2019

Is there a way to hide certain part of a web page based on a custom guard with Laravel?

I know you can restrict controller function access with

public function __construct(){
        $this->middleware('auth');
    }

But that controls the access for the whole webpage or blade file.

I want to show parts of a website only to some users based on a custom guard, like for admins. I know you could use @auth or @guest for normal authorization, but is there a way to do the same thing for a new guard?

(Sorry if dumb question)




Aucun commentaire:

Enregistrer un commentaire