“Logout in Laravel 8” Code-Antworten

Laravel Logout

//make a route as a post 
Route::post("/logout",[LogoutController::class,"store"])->name("logout");
//and make a form in your template or what ever you frontend client..
<form action="{{ route('logout') }}" method="post">
       @csrf
       <button type="submit">Logout</button>
</form>
//Controller will be like this.
public function store(Request $request) {
        auth()->logout();
        return redirect()->route('login');
    }
Azizul7m

Logout in Laravel 8

#route
Route::get('logout', '\App\Http\Controllers\Auth\LoginController@logout');

#controller
use Auth;
public function logout(Request $request) {
  Auth::logout();
  return redirect('/login');
}

#
Puzzled Panther

Laravel 8 make: auth

composer require laravel/ui
php artisan ui bootstrap --auth
invisible_eye98

Laravel 8 Login -Abmelde

if (Auth::once($credentials)) {
    //
}
Glamorous Gnu

Ähnliche Antworten wie “Logout in Laravel 8”

Fragen ähnlich wie “Logout in Laravel 8”

Weitere verwandte Antworten zu “Logout in Laravel 8” auf PHP

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen