Файловый менеджер - Редактировать - /home/clickysoft/public_html/travel-guru.clickysoft.net/app/Http/Requests/Admin/GuidedGroupTripUpdateRequest.php
Назад
<?php namespace App\Http\Requests\Admin; use App\Rules\HighlightRules; use Illuminate\Foundation\Http\FormRequest; class GuidedGroupTripUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array<string, mixed> */ public function rules() { $rules = [ 'title' => 'required|unique:guided_group_trips,title,' . request()->route('id'), 'slug' => 'required|unique:guided_group_trips,slug,' . request()->route('id'), 'status' => 'required|boolean', 'from_date' => 'required|date', 'to_date' => 'required|date|after_or_equal:from_date', 'price' => 'required', 'price_per_night' => 'required', 'short_description' => [ 'required', function ($attribute, $value, $fail) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 1000) { $fail("The Short Description must be between 10 and 1000 characters."); } }, ], 'long_description' => [ 'required', function ($attribute, $value, $fail) { if (!empty($value)) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 200000) { $fail("The Trip Type Description 1 must be between 10 and 200000 characters."); } } }, ], 'long_description_2' => [ 'required', function ($attribute, $value, $fail) { if (!empty($value)) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 200000) { $fail("The Trip Type Description 2 must be between 10 and 200000 characters."); } } }, ], 'packages_description' => [ 'nullable', function ($attribute, $value, $fail) { if (!empty($value)) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 20000) { $fail("The optional land extension must be between 10 and 20000 characters."); } } }, ], 'long_description_first_sections' => [ 'required', function ($attribute, $value, $fail) { if (!empty($value)) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 200000) { $fail("The Dive Overview Description must be between 10 and 200000 characters."); } } }, ], 'join_trip_description' => [ 'required', function ($attribute, $value, $fail) { if (!empty($value)) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 200000) { $fail("The Accommodation (About Atmosphere) must be between 10 and 200000 characters."); } } }, ], 'join_trip_description_extra' => [ 'required', function ($attribute, $value, $fail) { if (!empty($value)) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 200000) { $fail("The How to get there must be between 10 and 200000 characters."); } } }, ], 'long_description_second_sections' => [ 'required', function ($attribute, $value, $fail) { if (!empty($value)) { $strippedText = strip_tags($value); $charCount = mb_strlen($strippedText); if ($charCount < 10 || $charCount > 200000) { $fail("The Payment Schedule must be between 10 and 200000 characters."); } } }, ], 'meta_description' => 'nullable|max:255', 'meta_keywords' => 'nullable|max:255', 'meta_abstract' => 'nullable|max:255', 'opengraph_title' => 'nullable|max:60', 'opengraph_description' => 'nullable|max:300', ]; $rules['highlights'] = new HighlightRules; $rules['include.*'] = 'required'; $rules['exclude.*'] = 'required'; $rules['trip_title.*'] = 'required'; return $rules; } public function messages() { return [ // 'packages_description.required' => 'The optional land extension description field is required', 'long_description.required' => 'The trip type description 1 field is required', 'long_description_2.required' => 'The trip type description 2 field is required', 'long_description_first_sections.required' => 'The dive overview description field is required', 'join_trip_description.required' => 'The accommodation (about atmosphere) field is required', 'join_trip_description_extra.required' => 'The How to get there is required', 'long_description_second_sections.required' => 'The payment schedule field is required', 'include.*.required' => 'Please select at least one include.', 'trip_title.*.required' => 'Please select at least one join trip.', 'activity.*.required' => 'Please select at least one activity.', 'exclude.*.required' => 'Please select at least one exclude.', ]; } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка