I have these routes:
Auth::routes();
Route::get('/home', 'LibraryController@home');
Route::get('/', 'LibraryController@index');
Auth::routes()
is generated by the command php artisan make::auth
. But, i don't want the index page to be under auth middleware group, the third route in the above list.
Here is the controller methods. index()
is for everyone and home()
for authenticated users.
public function index()
{
return view('index');
}
public function home()
{
return view('home')->with('message','Logged in!');
}
the login users is redirected to home url:
protected $redirectTo = '/home';
But whenever i run the third route the login page appears. so, how can i remove that route from auth middleware group.
Route::get('/', 'LibraryController@index');
route to be under auth middleware. – Steve