I'm making an app in Laravel 5.2. I'm trying to implement an auth page for the backoffice.
In routes I've got a group and auth middleware:
Route::group(['prefix' => 'admin'], function () { Route::group(['middleware' => 'auth'], function () { Route::get('/', 'IndexController@admin_index')->name('admin_index'); Route::get('/logout', 'IndexController@admin_logout')->name('logout'); }); Route::get('/login', 'UsersController@admin_login')->name('login'); }); What I want to accomplish here is when I enter "/admin", if a user is logged, redirect to "/", if not, redirect to "/admin/login"
The current behavior is redirect to "/login" on unsuccessful login, how can I change that?