Answers for "laravel ui logout"

PHP
3

laravel logout

//make a route as a post and button should look like this
 <form action="{{ route('logout') }}" method="post">
       @csrf
       <button type="submit">Logout</button>
</form>
//Controller will be like this.
public function store(){
        auth()->logout();
        return redirect()->route('home');
    }
Posted by: Guest on September-04-2021
1

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');
}

#
Posted by: Guest on October-22-2021

Browse Popular Code Answers by Language