// Using the global helper to generate a redirect response
Route::get('redirect-with-helper', function () {
return redirect()->to('login');
});
// Using the global helper shortcut
Route::get('redirect-with-helper-shortcut', function () {
return redirect('login');
});
// Using the facade to generate a redirect response
Route::get('redirect-with-facade', function () {
return Redirect::to('login');
});
// Using the Route::redirect shortcut in Laravel 5.5+
Route::redirect('redirect-by-route', 'login');