| Total Complexity | 7 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Coverage | 95.65% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class UpdateRequest extends FormRequest |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * {@inheritDoc} |
||
| 13 | */ |
||
| 14 | 1 | public function authorize() |
|
| 15 | { |
||
| 16 | 1 | return !is_null($this->user()); |
|
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritDoc} |
||
| 21 | */ |
||
| 22 | 1 | public function rules() |
|
| 23 | { |
||
| 24 | return [ |
||
| 25 | // |
||
| 26 | 1 | ]; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * {@inheritDoc} |
||
| 31 | */ |
||
| 32 | 1 | public function attributes() |
|
| 33 | { |
||
| 34 | return [ |
||
| 35 | 1 | 'name' => trans('Name'), |
|
| 36 | 1 | 'value' => trans('Value'), |
|
| 37 | 1 | 'type' => trans('Type'), |
|
| 38 | 1 | 'quantity_per_bundle' => trans('Quantity Per Bundle'), |
|
| 39 | 1 | 'minimum_order_bundle' => trans('Minimum Order Bundle'), |
|
| 40 | 1 | 'maximum_order_bundle' => trans('Maximum Order Bundle'), |
|
| 41 | 1 | 'image' => trans('Image'), |
|
| 42 | ]; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Update the image file from the incoming request. |
||
| 47 | * |
||
| 48 | * @param string $key |
||
| 49 | * @return string|null |
||
| 50 | */ |
||
| 51 | 1 | public function updateImage(string $key = 'image'): ?string |
|
| 72 | } |
||
| 73 | } |
||
| 74 |