Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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

logout in laravel

//route
Route::get('logout',[AuthController::class, 'logout'])->name('logout');

//logout function
use Auth,Session;
public function logout(){
  Auth::logout();
  Session::flush();
  return redirect()->route('login');
}

<a href="{{ route('admin_logout') }}">Log Out </a>
Comment

logout in laravel 8

#route
Route::get('logout', 'AppHttpControllersAuthLoginController@logout');

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

#
Comment

PREVIOUS NEXT
Code Example
Php :: woocommerce cart button shortcode 
Php :: php convert spaces to underscores 
Php :: In PackageManifest.php line 131: Undefined index: name laravel 7 
Php :: string replace twig 
Php :: add a year php 
Php :: hide php extension htaccess 
Php :: php str_replace 
Php :: image upload form 
Php :: debug wordpress errors 
Php :: laravel uppercase first letter 
Php :: php post self 
Php :: laravel ever over https 
Php :: wordpress get the main url 
Php :: php echo json 
Php :: laravel carbon get year number 
Php :: url encode php 
Php :: laravel migration remove column 
Php :: wp custom rest endpoint 
Php :: formate date using carbon in laravel blade 
Php :: php convert degrees to radians 
Php :: year shortcode 
Php :: php get url path name 
Php :: get user ip laravel 
Php :: php mysqli connection check 
Php :: php open url 
Php :: form post self php 
Php :: laravel make migration controller resource mcr 
Php :: php close window after script runs 
Php :: How to Disable the WordPress JSON REST API Without Plugin 
Php :: default php timezone to newyork 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =