“Logout di Laravel 8” 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 8 Make: auth

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

Laravel 8 Login Logout

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

Jawaban yang mirip dengan “Logout di Laravel 8”

Pertanyaan yang mirip dengan “Logout di Laravel 8”

Lebih banyak jawaban terkait untuk “Logout di Laravel 8” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya