Answers for "laravel sanctum Provoking tokens"

PHP
1

laravel sanctum issue token

use Illuminate\Http\Request;

Route::post('/tokens/create', function (Request $request) {
    $token = $request->user()->createToken($request->token_name);

    return ['token' => $token->plainTextToken];
});
Posted by: Guest on July-22-2021
0

laravel sanctum Provoking tokens

// Revoke all tokens...
$user->tokens()->delete();

// Revoke a specific token...
$user->tokens()->where('id', $tokenId)->delete();
Posted by: Guest on July-24-2021

Browse Popular Code Answers by Language