Файловый менеджер - Редактировать - /home/clickysoft/public_html/securebeans.clickysoft.net/app/Http/Requests/UpdateCrmCustomerRequest.php
Назад
<?php namespace App\Http\Requests; use App\Models\CrmCustomer; use Gate; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Http\Response; class UpdateCrmCustomerRequest extends FormRequest { public function authorize() { if(Gate::denies('customer_edit')){ return redirect()->back()->with('error','Role not authorized.'); } return true; } public function rules() { return [ 'name' => [ 'required', function ($attribute, $value, $fail) { foreach(CrmCustomer::all() as $customer){ if ($value === $customer['name'] && $this->customer != $customer['id']) { $fail('Customer Name should be unique.'); } } }, ], 'sales_manager_id' => [ 'required', 'integer' ], 'email' => 'required|email|unique:crm_customers,email,'.$this->id, ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка