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?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire