File manager - Edit - /var/www/html/spdc/api/app/Http/Requests/ExternalAgentRequest.php
Back
<?php namespace App\Http\Requests; use App\Rules\ArrayInput; use Illuminate\Foundation\Http\FormRequest; class ExternalAgentRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $rules = [ 'name' => ['required', 'unique:external_agents,name'], 'phones' => ['nullable', new ArrayInput()], 'phones.*.ddd' => ['required', 'size:2'], 'phones.*.number' => ['required', 'min:8', 'max:9'], 'phones.*.owner' => ['nullable', 'max:255'], ]; if ($this->route()->getName() === 'external-agent.update') { $rules['name'] = ['required', 'max:255', 'unique:external_agents,name,'. $this->route('external_agent')->id]; } return $rules; } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings