A
A
Alex Orlov2016-04-03 01:40:39
User identification
Alex Orlov, 2016-04-03 01:40:39

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

4 answer(s)
A
Andrzej Wielski, 2016-04-04
@firohn

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.

E
Evgeny Perin, 2016-04-03
@seoperin

Instead of it is easier to distinguish the rights? Different permissions for different modules.

V
Vyacheslav Plisko, 2016-04-03
@AmdY

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.

A
Alex Orlov, 2016-04-05
@firohn

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 question

Ask a Question

731 491 924 answers to any question