auth.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Authentication Defaults
  6. |--------------------------------------------------------------------------
  7. |
  8. | This option controls the default authentication "guard" and password
  9. | reset options for your application. You may change these defaults
  10. | as required, but they're a perfect start for most applications.
  11. |
  12. */
  13. 'defaults' => [
  14. 'guard' => 'admin',
  15. 'passwords' => 'users',
  16. ],
  17. /*
  18. |--------------------------------------------------------------------------
  19. | Authentication Guards
  20. |--------------------------------------------------------------------------
  21. |
  22. | Next, you may define every authentication guard for your application.
  23. | Of course, a great default configuration has been defined for you
  24. | here which uses session storage and the Eloquent user provider.
  25. |
  26. | All authentication drivers have a user provider. This defines how the
  27. | users are actually retrieved out of your database or other storage
  28. | mechanisms used by this application to persist your user's data.
  29. |
  30. | Supported: "session", "token"
  31. |
  32. */
  33. 'guards' => [
  34. 'api' => [
  35. 'driver' => 'jwt',
  36. 'provider' => 'workers',
  37. 'hash' => false,
  38. ],
  39. 'admin' => [
  40. 'driver' => 'jwt',
  41. 'provider' => 'admin-users',
  42. 'hash' => false,
  43. ],
  44. ],
  45. /*
  46. |--------------------------------------------------------------------------
  47. | User Providers
  48. |--------------------------------------------------------------------------
  49. |
  50. | All authentication drivers have a user provider. This defines how the
  51. | users are actually retrieved out of your database or other storage
  52. | mechanisms used by this application to persist your user's data.
  53. |
  54. | If you have multiple user tables or models you may configure multiple
  55. | sources which represent each model / table. These sources may then
  56. | be assigned to any extra authentication guards you have defined.
  57. |
  58. | Supported: "database", "eloquent"
  59. |
  60. */
  61. 'providers' => [
  62. 'workers' => [
  63. 'driver' => 'eloquent',
  64. 'model' => App\Models\AdminUser::class,
  65. ],
  66. 'admin-users' => [
  67. 'driver' => 'eloquent',
  68. 'model' => App\Models\AdminUser::class,
  69. ],
  70. // 'users' => [
  71. // 'driver' => 'database',
  72. // 'table' => 'users',
  73. // ],
  74. ],
  75. /*
  76. |--------------------------------------------------------------------------
  77. | Resetting Passwords
  78. |--------------------------------------------------------------------------
  79. |
  80. | You may specify multiple password reset configurations if you have more
  81. | than one user table or model in the application and you want to have
  82. | separate password reset settings based on the specific user types.
  83. |
  84. | The expire time is the number of minutes that the reset token should be
  85. | considered valid. This security feature keeps tokens short-lived so
  86. | they have less time to be guessed. You may change this as needed.
  87. |
  88. */
  89. 'passwords' => [
  90. 'users' => [
  91. 'provider' => 'admin-users',
  92. 'table' => 'password_resets',
  93. 'expire' => 60,
  94. ],
  95. ],
  96. ];