auth.php 3.7 KB

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