Answer the question
In order to leave comments, you need to log in
Laravel. Authorization, how to correctly register rights (Gate)?
Hello. Question about authorization
I have a public part (online store) and an administrative part.
And the complex logic with access rights, before registering rights (Gate::...), I must understand in which part of the application the user is located.
Or he is in the administrative, then one logic, if in the online storefront - another logic.
The question is, how can I do it better?
The first thing that came to mind is that it can resolve at the middleware level, tie all administrative routers into middleware (example app:admin)
and register Gate rights inside. For the online storefront app:shop.
But, how correct is it to register access rights in middleware?
What other possibilities are there to implement this?
Thank you.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question