Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

302
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda