Answers for "logout user with bearer token laravel"

PHP
3

laravel get authorization bearer token

//get Authorization Bearer Token value
$token = $request->bearerToken();
Posted by: Guest on October-11-2020
0

laravel token logout

public function logout (Request $request) {
$accessToken = auth()->user()->token();
$token= $request->user()->tokens->find($accessToken);
$token->revoke();
return response(['message' => 'You have been successfully logged out.'], 200);
}
Posted by: Guest on December-09-2020

Code answers related to "logout user with bearer token laravel"

Browse Popular Code Answers by Language