Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/app/Rules/ValidateDate.php
Назад
<?php namespace App\Rules; use Carbon\Carbon; use Illuminate\Contracts\Validation\InvokableRule; class ValidateDate implements InvokableRule { public function __invoke($attribute, $value, $fail) { if ($attribute == 'date_scheduled') $message = 'The date scheduled can not be weekend.'; else if ($attribute == 'delivery_date') $message = 'The delivery date can not be weekend.'; else $message = 'The date pick up / ship by can not be weekend.'; try { $date = Carbon::make($value); if ($date->isWeekend()) $fail($message); } catch (\Exception $e){ // $fail('The :attribute is not a valid date.'); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка