Answer the question
In order to leave comments, you need to log in
Separation into backend and frontend in laravel 5?
How do you separate the project into frontend and admin? If you do without any extensions, what is the sequence of actions? How are users filtered, through middleware or something else? I tried using middleware, but somehow I got confused, I got one controller for the entire admin panel))
I am new to frameworks, although I have been trying to approach them for quite a long time ... Please tell me
Answer the question
In order to leave comments, you need to log in
I did it, please correct it if it's not correct ...
In routes:
Route::filter('admin', function(){
if(Auth::check()){
//Проверяем является ли юзер админом
if(Auth::User()->role != 'admin'){
return Redirect::to('/');
}
}else{
return Redirect::guest('auth/login');
}
});
Route::group(['prefix' => 'admin', 'before' => 'admin'], function(){
.........
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question