Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel sanctum issue token

use IlluminateHttpRequest;

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

    return ['token' => $token->plainTextToken];
});
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #sanctum #issue #token
ADD COMMENT
Topic
Name
6+2 =