Answer the question
In order to leave comments, you need to log in
How to separate an application into an admin part and a user account?
The site will have an admin part with the path /admin/ and a user account /cabinet/. It is necessary that the admin can see only his part, and the user only his. I divided the controllers into directories. There is an idea to make two middlewares and put them on groups of routes. Am I right, or is there another way to do this?
Answer the question
In order to leave comments, you need to log in
I made this a little crutch, but maybe it will do for you:
In the template
@if(Auth::check())
@if(Auth::user()->admin == 1)
%контент, отображаемый для администратора%
@endif
%контент, отображаемый для рядового юзера%
@endif
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question