git commit "fix: persianDatepicker did not initialize due to jQuery loading after content

This commit is contained in:
2026-08-20 09:05:15 +03:30
parent fa291c7108
commit 73c8e52414
16 changed files with 175 additions and 61 deletions
+18 -3
View File
@@ -2,6 +2,7 @@
namespace App\Http\Requests\Admin;
use Hekmatinasser\Verta\Verta;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
@@ -44,8 +45,22 @@ class FlightStoreRequest extends FormRequest
'max:100'
],
'departure_date' => [
'required'
],
'required',
function ($attribute, $value, $fail) {
try {
$gregorian = Verta::parse($value)
->formatGregorian('Y-m-d');
} catch (\Exception $e) {
$fail('تاریخ حرکت معتبر نیست.');
return;
}
if ($gregorian < now()->format('Y-m-d')) {
$fail('تاریخ حرکت نمی‌تواند قبل از تاریخ امروز باشد.');
}
},
],
'departure_time' => [
'required',
'date_format:H:i'
@@ -69,7 +84,7 @@ class FlightStoreRequest extends FormRequest
'min:0'
],
'image' => [
'required',
$this->isMethod('put') || $this->isMethod('patch') ? 'nullable' : 'required',
'image',
'mimes:jpg,jpeg,png,webp',
'max:2048'
+60 -2
View File
@@ -2,6 +2,7 @@
namespace App\Http\Requests\Admin;
use Hekmatinasser\Verta\Verta;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
@@ -12,7 +13,7 @@ class TourStoreRequest extends FormRequest
*/
public function authorize(): bool
{
return false;
return true;
}
/**
@@ -23,7 +24,64 @@ class TourStoreRequest extends FormRequest
public function rules(): array
{
return [
//
'title' => [
'required',
'string',
'max:150'
],
'travel_type_id' => [
'required',
'integer',
'exists:travel_types,id'
],
'summary' => [
'nullable',
'string',
'max:255'
],
'description' => [
'nullable',
'string'
],
'price' => [
'required',
'numeric',
'min:0'
],
'departure_date' => [
'required',
'string',
function ($attribute, $value, $fail) {
try {
$gregorian = Verta::parse($value)
->formatGregorian('Y-m-d');
} catch (\Exception $e) {
$fail('تاریخ حرکت معتبر نیست.');
return;
}
if ($gregorian < now()->format('Y-m-d')) {
$fail('تاریخ حرکت نمی‌تواند قبل از تاریخ امروز باشد.');
}
},
],
'image' => [
$this->isMethod('put') || $this->isMethod('patch') ? 'nullable' : 'required',
'image',
'mimes:jpg,jpeg,png,webp',
'max:2048'
],
'views' => [
'nullable',
'integer',
'min:0'
],
'status' => [
'required',
'in:0,1,2'
]
];
}
}