|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +use Illuminate\Support\Str; |
| 4 | + |
3 | 5 | return [ |
4 | 6 |
|
5 | 7 | /* |
6 | 8 | |-------------------------------------------------------------------------- |
7 | | - | Authentication Defaults |
| 9 | + | Default Cache Store |
8 | 10 | |-------------------------------------------------------------------------- |
9 | 11 | | |
10 | | - | This option controls the default authentication "guard" and password |
11 | | - | reset options for your application. You may change these defaults |
12 | | - | as required, but they're a perfect start for most applications. |
| 12 | + | This option controls the default cache store that will be used by the |
| 13 | + | framework. This connection is utilized if another isn't explicitly |
| 14 | + | specified when running a cache operation inside the application. |
13 | 15 | | |
14 | 16 | */ |
15 | 17 |
|
16 | | - 'defaults' => [ |
17 | | - 'guard' => env('AUTH_GUARD', 'web'), |
18 | | - 'passwords' => env('AUTH_PASSWORD_BROKER', 'users'), |
19 | | - ], |
| 18 | + 'default' => env('CACHE_STORE', 'database'), |
20 | 19 |
|
21 | 20 | /* |
22 | 21 | |-------------------------------------------------------------------------- |
23 | | - | Authentication Guards |
| 22 | + | Cache Stores |
24 | 23 | |-------------------------------------------------------------------------- |
25 | 24 | | |
26 | | - | Next, you may define every authentication guard for your application. |
27 | | - | Of course, a great default configuration has been defined for you |
28 | | - | here which uses session storage and the Eloquent user provider. |
| 25 | + | Here you may define all of the cache "stores" for your application as |
| 26 | + | well as their drivers. You may even define multiple stores for the |
| 27 | + | same cache driver to group types of items stored in your caches. |
29 | 28 | | |
30 | | - | All authentication drivers have a user provider. This defines how the |
31 | | - | users are actually retrieved out of your database or other storage |
32 | | - | mechanisms used by this application to persist your user's data. |
33 | | - | |
34 | | - | Supported: "session" |
| 29 | + | Supported drivers: "array", "database", "file", "memcached", |
| 30 | + | "redis", "dynamodb", "octane", "null" |
35 | 31 | | |
36 | 32 | */ |
37 | 33 |
|
38 | | - 'guards' => [ |
39 | | - 'web' => [ |
40 | | - 'driver' => 'session', |
41 | | - 'provider' => 'users', |
| 34 | + 'stores' => [ |
| 35 | + |
| 36 | + 'array' => [ |
| 37 | + 'driver' => 'array', |
| 38 | + 'serialize' => false, |
42 | 39 | ], |
43 | | - ], |
44 | 40 |
|
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 | | - */ |
| 41 | + 'database' => [ |
| 42 | + 'driver' => 'database', |
| 43 | + 'connection' => env('DB_CACHE_CONNECTION'), |
| 44 | + 'table' => env('DB_CACHE_TABLE', 'cache'), |
| 45 | + 'lock_connection' => env('DB_CACHE_LOCK_CONNECTION'), |
| 46 | + 'lock_table' => env('DB_CACHE_LOCK_TABLE'), |
| 47 | + ], |
61 | 48 |
|
62 | | - 'providers' => [ |
63 | | - 'users' => [ |
64 | | - 'driver' => 'eloquent', |
65 | | - 'model' => env('AUTH_MODEL', App\Models\User::class), |
| 49 | + 'file' => [ |
| 50 | + 'driver' => 'file', |
| 51 | + 'path' => storage_path('framework/cache/data'), |
| 52 | + 'lock_path' => storage_path('framework/cache/data'), |
66 | 53 | ], |
67 | 54 |
|
68 | | - // 'users' => [ |
69 | | - // 'driver' => 'database', |
70 | | - // 'table' => 'users', |
71 | | - // ], |
72 | | - ], |
| 55 | + 'memcached' => [ |
| 56 | + 'driver' => 'memcached', |
| 57 | + 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), |
| 58 | + 'sasl' => [ |
| 59 | + env('MEMCACHED_USERNAME'), |
| 60 | + env('MEMCACHED_PASSWORD'), |
| 61 | + ], |
| 62 | + 'options' => [ |
| 63 | + // Memcached::OPT_CONNECT_TIMEOUT => 2000, |
| 64 | + ], |
| 65 | + 'servers' => [ |
| 66 | + [ |
| 67 | + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), |
| 68 | + 'port' => env('MEMCACHED_PORT', 11211), |
| 69 | + 'weight' => 100, |
| 70 | + ], |
| 71 | + ], |
| 72 | + ], |
73 | 73 |
|
74 | | - /* |
75 | | - |-------------------------------------------------------------------------- |
76 | | - | Resetting Passwords |
77 | | - |-------------------------------------------------------------------------- |
78 | | - | |
79 | | - | You may specify multiple password reset configurations if you have more |
80 | | - | than one user table or model in the application and you want to have |
81 | | - | separate password reset settings based on the specific user types. |
82 | | - | |
83 | | - | The expire time is the number of minutes that each reset token will be |
84 | | - | considered valid. This security feature keeps tokens short-lived so |
85 | | - | they have less time to be guessed. You may change this as needed. |
86 | | - | |
87 | | - */ |
| 74 | + 'redis' => [ |
| 75 | + 'driver' => 'redis', |
| 76 | + 'connection' => env('REDIS_CACHE_CONNECTION', 'cache'), |
| 77 | + 'lock_connection' => env('REDIS_CACHE_LOCK_CONNECTION', 'default'), |
| 78 | + ], |
88 | 79 |
|
89 | | - 'passwords' => [ |
90 | | - 'users' => [ |
91 | | - 'provider' => 'users', |
92 | | - 'table' => env('AUTH_PASSWORD_RESET_TOKEN_TABLE', 'password_reset_tokens'), |
93 | | - 'expire' => 60, |
94 | | - 'throttle' => 60, |
| 80 | + 'dynamodb' => [ |
| 81 | + 'driver' => 'dynamodb', |
| 82 | + 'key' => env('AWS_ACCESS_KEY_ID'), |
| 83 | + 'secret' => env('AWS_SECRET_ACCESS_KEY'), |
| 84 | + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), |
| 85 | + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), |
| 86 | + 'endpoint' => env('DYNAMODB_ENDPOINT'), |
95 | 87 | ], |
| 88 | + |
| 89 | + 'octane' => [ |
| 90 | + 'driver' => 'octane', |
| 91 | + ], |
| 92 | + |
96 | 93 | ], |
97 | 94 |
|
98 | 95 | /* |
99 | 96 | |-------------------------------------------------------------------------- |
100 | | - | Password Confirmation Timeout |
| 97 | + | Cache Key Prefix |
101 | 98 | |-------------------------------------------------------------------------- |
102 | 99 | | |
103 | | - | Here you may define the amount of seconds before a password confirmation |
104 | | - | times out and the user is prompted to re-enter their password via the |
105 | | - | confirmation screen. By default, the timeout lasts for three hours. |
| 100 | + | When utilizing the APC, database, memcached, Redis, and DynamoDB cache |
| 101 | + | stores, there might be other applications using the same cache. For |
| 102 | + | that reason, you may prefix every cache key to avoid collisions. |
106 | 103 | | |
107 | 104 | */ |
108 | 105 |
|
109 | | - 'password_timeout' => env('AUTH_PASSWORD_TIMEOUT', 10800), |
| 106 | + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), |
110 | 107 |
|
111 | 108 | ]; |
0 commit comments