| 1234567891011121314151617181920 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class UnitMediaRequest extends FormRequest
- {
- public function rules(): array
- {
- $isUpdate = $this->isMethod('PUT') || $this->isMethod('PATCH');
- return [
- 'unit_id' => 'required|integer|exists:units,id',
- 'title' => 'required|string|max:255',
- 'file' => ($isUpdate ? 'nullable' : 'required') . '|file|max:51200',
- 'visible_to_franchisee' => 'boolean',
- ];
- }
- }
|