| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 90% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class StoreRequest extends AbstractRequest |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * {@inheritDoc} |
||
| 12 | */ |
||
| 13 | 1 | public function rules() |
|
| 14 | { |
||
| 15 | return [ |
||
| 16 | 1 | 'name' => 'required|string|max:255', |
|
| 17 | 'value' => 'required|numeric|min:0|unique:' . Denomination::class, |
||
| 18 | 'type' => 'required|enum:' . DenominationType::class, |
||
| 19 | 'quantity_per_bundle' => 'required|numeric|min:0', |
||
| 20 | 'minimum_order_bundle' => 'required|numeric|min:0', |
||
| 21 | 'maximum_order_bundle' => 'required|numeric|gte:minimum_order_bundle', |
||
| 22 | 'image' => 'sometimes|nullable|image', |
||
| 23 | ]; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Store the image file from the incoming request. |
||
| 28 | * |
||
| 29 | * @param string $key |
||
| 30 | * @return string|null |
||
| 31 | */ |
||
| 32 | 1 | public function storeImage(string $key = 'image'): ?string |
|
| 46 | } |
||
| 47 | } |
||
| 48 |