Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Rules/CheckSpecialOfferResortRoomRules.php
Назад
<?php namespace App\Rules; use App\Models\DealSpecialOffer; use App\Models\DealSpecialOfferAccommodationType; use Closure; use Illuminate\Contracts\Validation\ValidationRule; class CheckSpecialOfferResortRoomRules implements ValidationRule { /** * Run the validation rule. * * @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail */ public function __construct($roomId) { $this->room_id = $roomId; } public function validate(string $attribute, mixed $value, Closure $fail): void { $exits = DealSpecialOfferAccommodationType::where('associated_id', $value) ->where('room_id', $this->room_id) ->exists(); if (!$this->room_id) { return; } if ($exits) { $fail('The selected room already exists for this resort.'); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка