vendredi 23 octobre 2015

Laravel 5 RESTful API - Understanding resource concepts

I am developing a RESTful API with Laravel 5. I have some resource in my routes.php file and everything works properly.

But now I had added auth.basic middleware and I want introduce the user roles and I got confused.

In my Controller I have a constructor to call 2 middleware, auth.basic and roles middleware, but cannot continue because of lack of knowledge.

What do I need? Well, I need to set the user roles who can access every controller, but cant achieve this. Im the Controller I would like to access the user to check his role and compare it with the role stablished on the Controller, but I don't know how to access the user, can you help me?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire