Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

install sanctum

composer require laravel/sanctum

php artisan vendor:publish --provider="LaravelSanctumSanctumServiceProvider"

php artisan migrate


"!!!!!!Next, if you plan to utilize Sanctum to authenticate an SPA, you should add Sanctum's middleware to your api middleware group within your application's app/Http/Kernel.php file:!!!!!"
'api' => [
    LaravelSanctumHttpMiddlewareEnsureFrontendRequestsAreStateful::class,
    'throttle:api',
    IlluminateRoutingMiddlewareSubstituteBindings::class,
],
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #install #sanctum
ADD COMMENT
Topic
Name
8+2 =