1👍
✅
I have solved this problem by uncommenting this middleware in app/Http/Kernel.php
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
according to https://laravel.com/docs/10.x/sanctum#sanctum-middleware
Source:stackexchange.com