Answer the question
In order to leave comments, you need to log in
Multiple authorizations in laravel?
Good day, I want to know if it is possible to make multiple authorizations in laravel 5?
What I mean - There are several modules and separate user tables for each module, you need to make authorizations in each module for your own table in the database.
Answer the question
In order to leave comments, you need to log in
No problem, just copy the Auth folder, change the namespace inside the files and change the name of the table.
But the solution is not the best - I advise you to use Entrust to separate access rights to a specific module.
Instead of it is easier to distinguish the rights? Different permissions for different modules.
Easily. Look at the config/auth.php config.
There, in the guards section, this has already been done for different middleware, for api and web.
Well, you can add your providers to providers.
Thank you all - everything turned out to be quite simple. The given answer is almost correct. For modularity, I use the package - modules For full-fledged work of authentication, you need to add more middleware and separate configs for the session and for auth.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question