jeudi 27 juillet 2017

Laravel: redirect from a prefix->middleware->group-> to login if not authenticated

This is my web routes page:

    Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::prefix('manage')->middleware('role:superadministrator|administrator|editor|author|contributor')->group(function () {
  Route::get('/', 'ManageController@index');
  Route::get('/dashboard', 'ManageController@dashboard')->name('manage.dashboard');
  Route::resource('/users', 'UserController');
  Route::resource('/permissions', 'PermissionController', ['except' => 'destroy']);
  Route::resource('/roles', 'RoleController', ['except' => 'destroy']);
  Route::resource('/marcas', 'MarcaController', ['except' => 'destroy']);
  Route::resource('/modelos', 'ModeloController', ['except' => 'destroy']);
});

Route::get('/home', 'HomeController@index')->name('home');

When I am not logged in, I see an error 403 page, which is right, but i want to redirect to default login page.

Any tips, please?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire