“Laravel logout” Kode Jawaban

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 di 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 Force Pengguna Logout

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

Laravel Token Logout

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

Jawaban yang mirip dengan “Laravel logout”

Pertanyaan yang mirip dengan “Laravel logout”

Lebih banyak jawaban terkait untuk “Laravel logout” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya