jeudi 28 avril 2016

How to use Entrust middleware inside a controller?

It is described in Entrust docs how to use middlewares with routes, but I could not find any instructions regarding their usage in controllers.

An example of what I want to do:

class QuizzesController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
        $this->middleware('role:admin|root'); // <---
    }

    ...
}

As you understand, this code does not work. How can I achieve the illustrated behavior?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1N3sipj
via IFTTT

Aucun commentaire:

Enregistrer un commentaire