| 12345678910111213141516171819202122232425 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class CompanyBenefitRequest extends FormRequest
- {
- public function rules(): array
- {
- $rules = [
- 'title' => 'sometimes|string|max:255',
- 'icon' => 'sometimes|string|max:100',
- 'description' => 'sometimes|nullable|string|max:500',
- 'order' => 'sometimes|integer|min:0',
- ];
- if ($this->isMethod('post')) {
- $rules['title'] = 'required|string|max:255';
- $rules['icon'] = 'required|string|max:100';
- }
- return $rules;
- }
- }
|