1use Illuminate\Http\Request;
2
3Route::post('/tokens/create', function (Request $request) {
4 $token = $request->user()->createToken($request->token_name);
5
6 return ['token' => $token->plainTextToken];
7});
1// Revoke all tokens...
2$user->tokens()->delete();
3
4// Revoke a specific token...
5$user->tokens()->where('id', $tokenId)->delete();