sanctum.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Stateful Domains
  6. |--------------------------------------------------------------------------
  7. |
  8. | Requests from the following domains / hosts will receive stateful API
  9. | authentication cookies. Typically, these should include your local
  10. | and production domains which access your API via a frontend SPA.
  11. |
  12. */
  13. 'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
  14. '%s%s',
  15. 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
  16. env('APP_URL') ? ','.parse_url(env('APP_URL'), PHP_URL_HOST) : ''
  17. ))),
  18. /*
  19. |--------------------------------------------------------------------------
  20. | Expiration Minutes
  21. |--------------------------------------------------------------------------
  22. |
  23. | This value controls the number of minutes until an issued token will be
  24. | considered expired. If this value is null, personal access tokens do
  25. | not expire. This won't tweak the lifetime of first-party sessions.
  26. |
  27. */
  28. 'expiration' => null,
  29. /*
  30. |--------------------------------------------------------------------------
  31. | Sanctum Middleware
  32. |--------------------------------------------------------------------------
  33. |
  34. | When authenticating your first-party SPA with Sanctum you may need to
  35. | customize some of the middleware Sanctum uses while processing the
  36. | request. You may change the middleware listed below as required.
  37. |
  38. */
  39. 'middleware' => [
  40. 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
  41. 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
  42. ],
  43. ];