I am using Laravel 5.4 and trying to implement authentication system. I used php artisan command make:auth to setup it. I edited the views according to my layout. Now, when
In your web.php (routes):
add:
Route::get('logout', '\App\Http\Controllers\Auth\LoginController@logout');
In your LoginController.php
add:
public function logout(Request $request) {
Auth::logout();
return redirect('/login');
}
Also, in the top of LoginController.php, after namespace
add:
use Auth;
Now, you are able to logout using yourdomain.com/logout URL or if you have created logout button, add href to /logout