Файловый менеджер - Редактировать - /home/clickysoft/public_html/benchexc.clickysoft.net/app/Http/Requests/Api/UpdateCompanyDataApiRequest.php
Назад
<?php namespace App\Http\Requests\Api; use Illuminate\Contracts\Validation\Validator; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Http\Exceptions\HttpResponseException; class UpdateCompanyDataApiRequest extends FormRequest { public function authorize() { return true; } public function rules() { if(request()->hasAny(['company_name', 'industry_id', 'contact_person_name', 'phone_number', 'location'])) { return [ 'company_name' => 'required|max:100', 'industry_id' => 'required|exists:industries,id', 'contact_person_name' => 'required|max:100', 'phone_number' => 'required|max:100', 'location' => 'required|max:255', ]; }else{ return [ 'description' => 'sometimes|max:800', 'year_established' => 'sometimes|nullable|date_format:Y', 'website_url' => 'sometimes|nullable|url:http,https,www|max:255', 'company_size' => 'sometimes|max:255', 'linkedin_profile_url' => 'sometimes|nullable|url:http,https,www|max:255', 'facebook_profile_url' => 'sometimes|nullable|url:http,https,www|max:255', 'instagram_profile_url' => 'sometimes|nullable|url:http,https,www|max:255', 'operating_hours' => 'sometimes|max:255', 'is_pseb' => 'sometimes|nullable|boolean', 'is_pasha' => 'sometimes|nullable|boolean' ]; } } protected function failedValidation(Validator $validator) { throw new HttpResponseException(makeJsonResponse('Error', [], 422, [], collect($validator->errors())->values()->map(fn($error) => $error))); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка