“Logout de Laravel” Respostas de código

Logout de Laravel

//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 em 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

Logout do usuário da Laravel Force

if (!Auth::user()->isActive()) {
    Auth::logout();

    return Redirect::home();
}
Alberto Peripolli

Auth Log Out Laravel

Auth::logout();
Lonely Ladybird

Laravel Auth

composer require laravel/ui

php artisan ui vue --auth

npm install && npm run dev
Almabek

Logout de token de Laravel

public function logout (Request $request) {
$accessToken = auth()->user()->token();
$token= $request->user()->tokens->find($accessToken);
$token->revoke();
return response(['message' => 'You have been successfully logged out.'], 200);
}
Super Starling

Respostas semelhantes a “Logout de Laravel”

Perguntas semelhantes a “Logout de Laravel”

Mais respostas relacionadas para “Logout de Laravel” em PHP

Procure respostas de código populares por idioma

Procurar outros idiomas de código