V
V
Vanik Khachatryan2018-02-18 10:13:19
Laravel
Vanik Khachatryan, 2018-02-18 10:13:19

How to protect routes through sessions?

During authorization, the "Role" (admin, user) is obtained from the database, and added to the session. How can I organize the protection of the route by checking the role from the session, for example:
Cabinet controller, only for user || admin.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pushkarev, 2018-02-18
@VaniXac

There is a middleware for this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question