Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
What's the proper value for "guard" and "middleware" in config/fortify.php file for a SPA?

I am building a single page application (SPA), I have followed the Laravel official document to use Fortify with Sanctum.

From the "SPA Authentication" section on sanctum page (https://laravel.com/docs/8.x/sanctum)

For a SAP, I need to use 'web' for "guard" attribute, but it didn't mention what is the proper value for "middleware" attribute?

And because it instructs you to add \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class to the api middleware group within app/Http/Kernel.php file.

So I assume I should use ['api'] for the middleware? What is the proper value for a SPA?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!