Laravel. Authorization how to register the rights (Gate)?

Hi all. Question about authorization
I have a public part (the Internet store) and an administrative part.
And complex logic with permissions before conducting the registration of rights (Gate::...) I need to understand what part of the application the user is.
Or it is administrative, then one logic, if in the online display - different logic.

The question is, how should I do that?
The first thing that came to mind, can the middleware handle, tie all administrative routerŅ‹ in middleware (app example:admin)
and inside already to register the right Gate. For Internet Windows app:shop.

But how much it is right in the middleware to register access rights?
What else has the ability to implement it?

Thank you.
March 23rd 20 at 19:42
1 answer
March 23rd 20 at 19:44
I think the problem is that you are using the Gate, and he provides only the permissions without roles. Try my module, it adds to the Gate of the role:
Laravel 5. Hierarchical RBAC for the little ones

Find more questions by tags Laravel