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