How to logout a user from API using laravel Passport - log out from all the devices where he's logged in

PHOTO EMBED

Wed Feb 16 2022 12:10:12 GMT+0000 (Coordinated Universal Time)

Saved by @WMOH

$tokens =  $user->tokens->pluck('id');
Token::whereIn('id', $tokens)
    ->update(['revoked', true]);

RefreshToken::whereIn('access_token_id', $tokens)->update(['revoked' => true]);
content_copyCOPY

https://stackoverflow.com/questions/43318310/how-to-logout-a-user-from-api-using-laravel-passport