|
1 | 1 | <?php
|
2 | 2 |
|
3 | 3 | return [
|
4 |
| - /** |
| 4 | + /* |
5 | 5 | * The package will use this format when working with dates. If this option
|
6 | 6 | * is an array, it will try to convert from the first format that works,
|
7 | 7 | * and will serialize dates using the first format from the array.
|
8 | 8 | */
|
9 | 9 | 'date_format' => DATE_ATOM,
|
10 | 10 |
|
11 |
| - /** |
| 11 | + /* |
12 | 12 | * When transforming or casting dates, the following timezone will be used to
|
13 | 13 | * convert the date to the correct timezone. If set to null no timezone will
|
14 | 14 | * be passed.
|
15 | 15 | */
|
16 | 16 | 'date_timezone' => null,
|
17 | 17 |
|
18 |
| - /** |
| 18 | + /* |
19 | 19 | * It is possible to enable certain features of the package, these would otherwise
|
20 | 20 | * be breaking changes, and thus they are disabled by default. In the next major
|
21 | 21 | * version of the package, these features will be enabled by default.
|
22 | 22 | */
|
23 | 23 | 'features' => [
|
24 | 24 | 'cast_and_transform_iterables' => false,
|
25 | 25 |
|
26 |
| - /** |
| 26 | + /* |
27 | 27 | * When trying to set a computed property value, the package will throw an exception.
|
28 | 28 | * You can disable this behaviour by setting this option to true, which will then just
|
29 | 29 | * ignore the value being passed into the computed property and recalculate it.
|
30 | 30 | */
|
31 | 31 | 'ignore_exception_when_trying_to_set_computed_property_value' => false,
|
32 | 32 | ],
|
33 | 33 |
|
34 |
| - /** |
| 34 | + /* |
35 | 35 | * Global transformers will take complex types and transform them into simple
|
36 | 36 | * types.
|
37 | 37 | */
|
|
41 | 41 | BackedEnum::class => Spatie\LaravelData\Transformers\EnumTransformer::class,
|
42 | 42 | ],
|
43 | 43 |
|
44 |
| - /** |
| 44 | + /* |
45 | 45 | * Global casts will cast values into complex types when creating a data
|
46 | 46 | * object from simple types.
|
47 | 47 | */
|
|
51 | 51 | // Enumerable::class => Spatie\LaravelData\Casts\EnumerableCast::class,
|
52 | 52 | ],
|
53 | 53 |
|
54 |
| - /** |
| 54 | + /* |
55 | 55 | * Rule inferrers can be configured here. They will automatically add
|
56 | 56 | * validation rules to properties of a data object based upon
|
57 | 57 | * the type of the property.
|
|
64 | 64 | Spatie\LaravelData\RuleInferrers\AttributesRuleInferrer::class,
|
65 | 65 | ],
|
66 | 66 |
|
67 |
| - /** |
| 67 | + /* |
68 | 68 | * Normalizers return an array representation of the payload, or null if
|
69 | 69 | * it cannot normalize the payload. The normalizers below are used for
|
70 | 70 | * every data object, unless overridden in a specific data object class.
|
|
78 | 78 | Spatie\LaravelData\Normalizers\JsonNormalizer::class,
|
79 | 79 | ],
|
80 | 80 |
|
81 |
| - /** |
| 81 | + /* |
82 | 82 | * Data objects can be wrapped into a key like 'data' when used as a resource,
|
83 | 83 | * this key can be set globally here for all data objects. You can pass in
|
84 | 84 | * `null` if you want to disable wrapping.
|
85 | 85 | */
|
86 | 86 | 'wrap' => null,
|
87 | 87 |
|
88 |
| - /** |
| 88 | + /* |
89 | 89 | * Adds a specific caster to the Symphony VarDumper component which hides
|
90 | 90 | * some properties from data objects and collections when being dumped
|
91 | 91 | * by `dump` or `dd`. Can be 'enabled', 'disabled' or 'development'
|
92 | 92 | * which will only enable the caster locally.
|
93 | 93 | */
|
94 | 94 | 'var_dumper_caster_mode' => 'development',
|
95 | 95 |
|
96 |
| - /** |
| 96 | + /* |
97 | 97 | * It is possible to skip the PHP reflection analysis of data objects
|
98 | 98 | * when running in production. This will speed up the package. You
|
99 | 99 | * can configure where data objects are stored and which cache
|
|
119 | 119 | ],
|
120 | 120 | ],
|
121 | 121 |
|
122 |
| - /** |
| 122 | + /* |
123 | 123 | * A data object can be validated when created using a factory or when calling the from
|
124 | 124 | * method. By default, only when a request is passed the data is being validated. This
|
125 | 125 | * behaviour can be changed to always validate or to completely disable validation.
|
126 | 126 | */
|
127 | 127 | 'validation_strategy' => \Spatie\LaravelData\Support\Creation\ValidationStrategy::OnlyRequests->value,
|
128 | 128 |
|
129 |
| - /** |
| 129 | + /* |
130 | 130 | * A data object can map the names of its properties when transforming (output) or when
|
131 | 131 | * creating (input). By default, the package will not map any names. You can set a
|
132 | 132 | * global strategy here, or override it on a specific data object.
|
|
136 | 136 | 'output' => null,
|
137 | 137 | ],
|
138 | 138 |
|
139 |
| - /** |
| 139 | + /* |
140 | 140 | * When using an invalid include, exclude, only or except partial, the package will
|
141 | 141 | * throw an exception. You can disable this behaviour by setting this option to true.
|
142 | 142 | */
|
143 | 143 | 'ignore_invalid_partials' => false,
|
144 | 144 |
|
145 |
| - /** |
| 145 | + /* |
146 | 146 | * When transforming a nested chain of data objects, the package can end up in an infinite
|
147 | 147 | * loop when including a recursive relationship. The max transformation depth can be
|
148 | 148 | * set as a safety measure to prevent this from happening. When set to null, the
|
149 | 149 | * package will not enforce a maximum depth.
|
150 | 150 | */
|
151 | 151 | 'max_transformation_depth' => null,
|
152 | 152 |
|
153 |
| - /** |
| 153 | + /* |
154 | 154 | * When the maximum transformation depth is reached, the package will throw an exception.
|
155 | 155 | * You can disable this behaviour by setting this option to true which will return an
|
156 | 156 | * empty array.
|
157 | 157 | */
|
158 | 158 | 'throw_when_max_transformation_depth_reached' => true,
|
159 | 159 |
|
160 |
| - /** |
161 |
| - * When using the `make:data` command, the package will use these settings to generate |
162 |
| - * the data classes. You can override these settings by passing options to the command. |
163 |
| - */ |
| 160 | + /* |
| 161 | + * When using the `make:data` command, the package will use these settings to generate |
| 162 | + * the data classes. You can override these settings by passing options to the command. |
| 163 | + */ |
164 | 164 | 'commands' => [
|
165 |
| - /** |
| 165 | + |
| 166 | + /* |
166 | 167 | * Provides default configuration for the `make:data` command. These settings can be overridden with options
|
167 | 168 | * passed directly to the `make:data` command for generating single Data classes, or if not set they will
|
168 | 169 | * automatically fall back to these defaults. See `php artisan make:data --help` for more information
|
169 | 170 | */
|
170 | 171 | 'make' => [
|
171 |
| - /** |
| 172 | + |
| 173 | + /* |
172 | 174 | * The default namespace for generated Data classes. This exists under the application's root namespace,
|
173 | 175 | * so the default 'Data` will end up as '\App\Data', and generated Data classes will be placed in the
|
174 | 176 | * app/Data/ folder. Data classes can live anywhere, but this is where `make:data` will put them.
|
175 | 177 | */
|
176 | 178 | 'namespace' => 'Data',
|
177 | 179 |
|
178 |
| - /** |
| 180 | + /* |
179 | 181 | * This suffix will be appended to all data classes generated by make:data, so that they are less likely
|
180 | 182 | * to conflict with other related classes, controllers or models with a similar name without resorting
|
181 | 183 | * to adding an alias for the Data object. Set to a blank string (not null) to disable.
|
|
184 | 186 | ],
|
185 | 187 | ],
|
186 | 188 |
|
187 |
| - /** |
| 189 | + /* |
188 | 190 | * When using Livewire, the package allows you to enable or disable the synths
|
189 | 191 | * these synths will automatically handle the data objects and their
|
190 | 192 | * properties when used in a Livewire component.
|
|
0 commit comments