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 :: group_concat laravel 
Php :: php maxupload 
Php :: redirect all request to public folder laravel htaccess 
Php :: php truncate string 
Php :: wordpress order by 
Php :: header location php 
Php :: Error: Call to a member function addEagerConstraints() on null in file 
Php :: how to disable/hide menu admin page wordpress dev 
Php :: Check duplicate email using Jquery validation 
Php :: php get age from dob 
Php :: how to add property to the request object 
Php :: how to hide .php extension using .htaccess 
Php :: laravel carbon get month number 
Php :: how if charactor is exist in text in laravel 
Php :: php artisan serve a folder 
Php :: datetime format laravel 
Php :: Print exact sql statement executed 
Php :: Interval Between Different Dates 
Php :: Changer le logo Admin WordPress 
Php :: Fetch Data From Database With MySQLI 
Php :: Split 10 email out of 50 email using coma separated via php 
Php :: enable shortcodes in text widgets 
Php :: php median 
Php :: symfony call another controller 
Php :: randomstring php 
Php :: InvalidArgumentException Unknown format "sentence" 
Php :: Google Dorks Using special search string to find vulnerable websites: 
Php :: Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 119541600 bytes) in C:xampphtdocsackup-vice.php on line 67 
Php :: php sql last 10 rows 
Php :: validate if correct image url php 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =