// open "app/Http/Kernal.php" // in "protected $middlewareGroups" // in "api" // uncomment this class: LaravelSanctumHttpMiddlewareEnsureFrontendRequestsAreStateful::class