Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Http/Requests/Admin/StoreAddressBookRequest.php
Назад
<?php namespace App\Http\Requests\Admin; use Gate; use Illuminate\Foundation\Http\FormRequest; class StoreAddressBookRequest extends FormRequest { public function authorize() { return (auth()->user()->user_type == 3 || Gate::allows('address_book_create')); } public function rules() { return [ 'user_id' => [ auth()->user()->user_type == 1 ? 'required' : 'nullable', 'exists:users,id', ], 'company_name' => [ 'nullable', 'string', 'max:50', ], 'primary_contact_name' => [ 'required', 'string', 'max:50', ], 'primary_contact_email' => [ 'required', 'email', ], 'secondary_contact_name' => [ 'nullable', 'string', 'max:50', ], 'secondary_contact_email' => [ 'nullable', 'email', ], 'address_line_1' => [ 'required', 'string', ], 'address_line_2' => [ 'nullable', 'string', ], 'city' => [ 'required', 'string', 'max:50', ], 'state_id' => [ 'required', 'integer', 'exists:state_sales_taxes,id', ], 'zipcode' => [ 'required', 'integer', 'max_digits:10', ], 'phone_number' => [ 'nullable', 'regex:/^[0-9]+$/', 'max_digits:20', ], 'is_default' => [ 'required', 'in:0,1', ], ]; } public function messages() { return [ 'zipcode.max_digits' => 'Zipcode can not contain more than 10 digits.', 'phone_number.max_digits' => 'Phone number can not contain more than 20 digits.', 'phone_number.regex' => 'Phone number can only contain numbers.', ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка