generated from rawilk/package-skeleton-laravel
-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsettings.php
208 lines (192 loc) · 7.23 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?php
declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------
| Settings Table
|--------------------------------------------------------------------------
|
| Database table used to store settings in.
|
*/
'table' => 'settings',
/*
|--------------------------------------------------------------------------
| Caching
|--------------------------------------------------------------------------
|
| If enabled, all settings are cached after accessing them.
|
*/
'cache' => true,
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| Specify a prefix to prepend to any setting key being cached.
|
*/
'cache_key_prefix' => 'settings.',
/*
|--------------------------------------------------------------------------
| Encryption
|--------------------------------------------------------------------------
|
| If enabled, all values are encrypted and decrypted.
|
*/
'encryption' => true,
/*
|--------------------------------------------------------------------------
| Driver
|--------------------------------------------------------------------------
|
| The driver to use to store and retrieve settings from. You are free
| to add more drivers in the `drivers` configuration below.
|
*/
'driver' => env('SETTINGS_DRIVER', 'eloquent'),
/*
|--------------------------------------------------------------------------
| Drivers
|--------------------------------------------------------------------------
|
| Here you may configure the driver information for each repository that
| is used by your application. A default configuration has been added
| for each back-end shipped with this package. You are free to add more.
|
| Each driver you add must implement the \Rawilk\Settings\Contracts\Driver interface.
|
*/
'drivers' => [
'database' => [
'driver' => 'database',
'connection' => env('DB_CONNECTION', 'mysql'),
],
'eloquent' => [
'driver' => 'eloquent',
/*
* You can use any model you like for the setting, but it needs to implement
* the \Rawilk\Settings\Contracts\Setting interface.
*/
'model' => \Rawilk\Settings\Models\Setting::class,
],
],
/*
|--------------------------------------------------------------------------
| Teams
|--------------------------------------------------------------------------
|
| When set to true the package implements teams using the `team_foreign_key`.
|
| If you want the migrations to register the `team_foreign_key`, you must
| set this to true before running the migration.
|
| If you already ran the migrations, then you must make a new migration to
| add the `team_foreign_key` column to the settings table, and update the
| unique constraint on the table. See the `add_settings_team_field` migration
| for how to do this.
|
*/
'teams' => false,
/*
|--------------------------------------------------------------------------
| Team Foreign Key
|--------------------------------------------------------------------------
|
| When teams is set to true, our database/eloquent drivers will use this
| column as a team foreign key to scope queries to.
|
| The team id will also be included in a cache key when caching is enabled.
|
*/
'team_foreign_key' => 'team_id',
/*
|--------------------------------------------------------------------------
| Context Serializer
|--------------------------------------------------------------------------
|
| The context serializer is responsible for converting a Context object
| into a string, which gets appended to a setting key in the database.
|
| Any custom serializer you use must implement the
| \Rawilk\Settings\Contracts\ContextSerializer interface.
|
| Supported:
| - \Rawilk\Settings\Support\ContextSerializers\ContextSerializer (default)
| - \Rawilk\Settings\Support\ContextSerializers\DotNotationContextSerializer
|
*/
'context_serializer' => \Rawilk\Settings\Support\ContextSerializers\ContextSerializer::class,
/*
|--------------------------------------------------------------------------
| Key Generator
|--------------------------------------------------------------------------
|
| The key generator is responsible for generating a suitable key for a
| setting.
|
| Any custom key generator you use must implement the
| \Rawilk\Settings\Contracts\KeyGenerator interface.
|
| Supported:
| - \Rawilk\Settings\Support\KeyGenerators\ReadableKeyGenerator
| - \Rawilk\Settings\Support\KeyGenerators\Md5KeyGenerator (default)
| - \Rawilk\Settings\Support\KeyGenerators\HashKeyGenerator
|
*/
'key_generator' => \Rawilk\Settings\Support\KeyGenerators\Md5KeyGenerator::class,
/*
|--------------------------------------------------------------------------
| Value Serializer
|--------------------------------------------------------------------------
|
| By default, we use php's serialize() and unserialize() functions to
| prepare the setting values for storage. You may use the `JsonValueSerializer`
| instead if you want to store the values as json instead.
|
| Any custom value serializer you use must implement the
| \Rawilk\Settings\Contracts\ValueSerializer interface.
|
*/
'value_serializer' => \Rawilk\Settings\Support\ValueSerializers\ValueSerializer::class,
/*
|--------------------------------------------------------------------------
| Cache Default Value
|--------------------------------------------------------------------------
|
| When a setting is not persisted, we will cache the passed in default value
| if this is set to true. This may not always be desirable, so you can
| disable it here if needed.
|
*/
'cache_default_value' => true,
/*
|--------------------------------------------------------------------------
| Unserialize Safelist
|--------------------------------------------------------------------------
|
| When using the default value serializer class from this package, we
| will only unserialize objects that have their classes safelisted here.
| Any other objects will be unserialized to something like:
| __PHP_Incomplete_Class(App\Models\User) {...}
|
| To prevent any objects from being unserialized, simply set this to
| an empty array.
*/
'unserialize_safelist' => [
\Carbon\Carbon::class,
\Carbon\CarbonImmutable::class,
\Illuminate\Support\Carbon::class,
],
/*
|--------------------------------------------------------------------------
| Hash Algorithm
|--------------------------------------------------------------------------
|
| The hashing algorithm to use for the HashKeyGenerator.
|
*/
'hash_algorithm' => 'xxh128',
];