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