Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to remove token while logout using laravel 8

//put this code in controller
public function logout()
    {
        $user = Auth::user()->token();
        $user->revoke();
        return response()->json('Successfully logged out');
    }
Comment

token delete laravel

public function logout() {
    Auth::user()->tokens->each(function($token, $key) {
        $token->delete();
    });

    return response()->json('Successfully logged out');
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel collection toArray 
Php :: attach multiple files in laravel mailable 
Php :: php yesterday date 
Php :: hash a password php 
Php :: create laravel project using laravel installer 
Php :: check session in blade laravel 
Php :: form validation nullable laravel 
Php :: php echo html as text 
Php :: wordpress custom loop 
Php :: livewire pagination bootstrap 
Php :: remove create in nova resource 
Php :: apache not executing php 
Php :: Remove “/public” from Laravel route 
Php :: db symfony 
Php :: laravel controller return message 
Php :: check exist string in string php 
Php :: laravel change column type 
Php :: magento 2 status mode 
Php :: php milliseconds 
Php :: laravel throw exception with status code 
Php :: object to array in php 
Php :: Making visible or hidden attributes from Eloquent temporarily 
Php :: while loop in laravel 
Php :: constructor in php 
Php :: Google_Service_Calendar Event Date Time 
Php :: artisan call migrate result 
Php :: php get all function arguments 
Php :: how do i logout wordpress without confirmation 
Php :: how convert big text to array that text have br in laravel 
Php :: php number format spaces 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =