fix(admin): resolve issues on tour edit page
This commit is contained in:
@@ -314,7 +314,7 @@ class TourController extends Controller
|
|||||||
->with('success', 'تور با موفقیت به سطل زباله منتقل شد.');
|
->with('success', 'تور با موفقیت به سطل زباله منتقل شد.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function restore( $id)
|
public function restore($id)
|
||||||
{
|
{
|
||||||
$tour = Tour::onlyTrashed()->findOrFail($id);
|
$tour = Tour::onlyTrashed()->findOrFail($id);
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Admin\Tour;
|
namespace App\Http\Requests\Admin\Tour;
|
||||||
|
|
||||||
use App\Enums\Flight\TourType;
|
|
||||||
use App\Enums\Tour\TourMode;
|
use App\Enums\Tour\TourMode;
|
||||||
use App\Enums\Tour\TourScope;
|
use App\Enums\Tour\TourScope;
|
||||||
|
use App\Enums\Tour\TourType;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Admin\Tour;
|
namespace App\Http\Requests\Admin\Tour;
|
||||||
|
|
||||||
use App\Enums\Flight\TourType;
|
|
||||||
use App\Enums\Tour\TourMode;
|
use App\Enums\Tour\TourMode;
|
||||||
use App\Enums\Tour\TourScope;
|
use App\Enums\Tour\TourScope;
|
||||||
|
use App\Enums\Tour\TourType;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<option value="">یک مورد را انتخاب کنید</option>
|
<option value="">یک مورد را انتخاب کنید</option>
|
||||||
@foreach(\App\Enums\Tour\TourScope::cases() as $scope)
|
@foreach(\App\Enums\Tour\TourScope::cases() as $scope)
|
||||||
<option value="{{ $scope->value }}"
|
<option value="{{ $scope->value }}"
|
||||||
{{ old('tour_scope', $tour->tour_scope?->value) == $scope->value ? 'selected' : '' }}>
|
{{ old('tour_scope', $tour->tour_scope?->value) == $scope->value ? 'selected' : '' }}>
|
||||||
{{ $scope->label() }}
|
{{ $scope->label() }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -68,12 +68,12 @@
|
|||||||
|
|
||||||
<div class="col-xl-6">
|
<div class="col-xl-6">
|
||||||
<label class="form-label">نوع حمل و نقل / سفر <span
|
<label class="form-label">نوع حمل و نقل / سفر <span
|
||||||
class="text-danger">*</span></label>
|
class="text-danger">*</span></label>
|
||||||
<select class="form-control" name="tour_mode">
|
<select class="form-control" name="tour_mode">
|
||||||
<option value="">یک مورد را انتخاب کنید</option>
|
<option value="">یک مورد را انتخاب کنید</option>
|
||||||
@foreach(\App\Enums\Tour\TourMode::cases() as $mode)
|
@foreach(\App\Enums\Tour\TourMode::cases() as $mode)
|
||||||
<option value="{{ $mode->value }}"
|
<option value="{{ $mode->value }}"
|
||||||
{{ old('tour_mode', $tour->tour_mode?->value) == $mode->value ? 'selected' : '' }}>
|
{{ old('tour_mode', $tour->tour_mode?->value) == $mode->value ? 'selected' : '' }}>
|
||||||
{{ $mode->label() }}
|
{{ $mode->label() }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -87,9 +87,9 @@
|
|||||||
<label class="form-label">سبک تور <span class="text-danger">*</span></label>
|
<label class="form-label">سبک تور <span class="text-danger">*</span></label>
|
||||||
<select class="form-control" name="tour_type">
|
<select class="form-control" name="tour_type">
|
||||||
<option value="">یک مورد را انتخاب کنید</option>
|
<option value="">یک مورد را انتخاب کنید</option>
|
||||||
@foreach(\App\Enums\Flight\TourType::cases() as $type)
|
@foreach(\App\Enums\Tour\TourType::cases() as $type)
|
||||||
<option value="{{ $type->value }}"
|
<option value="{{ $type->value }}"
|
||||||
{{ old('tour_type', $tour->tour_type?->value) == $type->value ? 'selected' : '' }}>
|
{{ old('tour_type', $tour->tour_type?->value) == $type->value ? 'selected' : '' }}>
|
||||||
{{ $type->label() }}
|
{{ $type->label() }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
<option value="">شهر مبدا را انتخاب کنید</option>
|
<option value="">شهر مبدا را انتخاب کنید</option>
|
||||||
@foreach($cities as $city)
|
@foreach($cities as $city)
|
||||||
<option value="{{ $city->id }}"
|
<option value="{{ $city->id }}"
|
||||||
{{ old('origin_city_id', $tour->origin_city_id) == $city->id ? 'selected' : '' }}>
|
{{ old('origin_city_id', $tour->origin_city_id) == $city->id ? 'selected' : '' }}>
|
||||||
{{ $city->name }}
|
{{ $city->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -119,11 +119,11 @@
|
|||||||
style="{{ $tour->tour_scope === \App\Enums\Tour\TourScope::INTERNATIONAL ? '' : 'display:none;' }}">
|
style="{{ $tour->tour_scope === \App\Enums\Tour\TourScope::INTERNATIONAL ? '' : 'display:none;' }}">
|
||||||
<label class="form-label">کشور مقصد</label>
|
<label class="form-label">کشور مقصد</label>
|
||||||
<select class="form-control" id="country_id"
|
<select class="form-control" id="country_id"
|
||||||
{{ $tour->tour_scope === \App\Enums\Tour\TourScope::INTERNATIONAL ? '' : 'disabled' }}>
|
{{ $tour->tour_scope === \App\Enums\Tour\TourScope::INTERNATIONAL ? '' : 'disabled' }}>
|
||||||
<option value="">یک مورد را انتخاب کنید</option>
|
<option value="">یک مورد را انتخاب کنید</option>
|
||||||
@foreach($countries as $country)
|
@foreach($countries as $country)
|
||||||
<option value="{{ $country->id }}"
|
<option value="{{ $country->id }}"
|
||||||
{{ $selectedCountryId == $country->id ? 'selected' : '' }}>
|
{{ $selectedCountryId == $country->id ? 'selected' : '' }}>
|
||||||
{{ $country->name }}
|
{{ $country->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
<option value="">شهر مقصد را انتخاب کنید</option>
|
<option value="">شهر مقصد را انتخاب کنید</option>
|
||||||
@foreach($destinationCities as $city)
|
@foreach($destinationCities as $city)
|
||||||
<option value="{{ $city->id }}"
|
<option value="{{ $city->id }}"
|
||||||
{{ old('destination_city_id', $tour->destination_city_id) == $city->id ? 'selected' : '' }}>
|
{{ old('destination_city_id', $tour->destination_city_id) == $city->id ? 'selected' : '' }}>
|
||||||
{{ $city->name }}
|
{{ $city->name }}
|
||||||
</option>
|
</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@@ -172,11 +172,11 @@
|
|||||||
<label class="form-label">تاریخ رفت (شروع)</label>
|
<label class="form-label">تاریخ رفت (شروع)</label>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="startDateInput"
|
id="startDateInput"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
name="start_date"
|
name="start_date"
|
||||||
value="{{ old(
|
value="{{ old(
|
||||||
'start_date',$departure?->start_date ? Verta::instance($departure->start_date)->format('Y/m/d H:i') : '' ) }}">
|
'start_date',$departure?->start_date ? Verta::instance($departure->start_date)->format('Y/m/d H:i') : '' ) }}">
|
||||||
@error('start_date')
|
@error('start_date')
|
||||||
<span class="text-danger small">{{ $message }}</span>
|
<span class="text-danger small">{{ $message }}</span>
|
||||||
@@ -187,11 +187,11 @@
|
|||||||
<label class="form-label">تاریخ برگشت (پایان)</label>
|
<label class="form-label">تاریخ برگشت (پایان)</label>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
id="endDateInput"
|
id="endDateInput"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
name="end_date"
|
name="end_date"
|
||||||
value="{{ old('end_date',$departure?->end_date ? Verta::instance($departure->end_date)->format('Y/m/d H:i') : '') }}">
|
value="{{ old('end_date',$departure?->end_date ? Verta::instance($departure->end_date)->format('Y/m/d H:i') : '') }}">
|
||||||
@error('end_date')
|
@error('end_date')
|
||||||
<span class="text-danger small">{{ $message }}</span>
|
<span class="text-danger small">{{ $message }}</span>
|
||||||
@enderror
|
@enderror
|
||||||
@@ -227,7 +227,7 @@
|
|||||||
alt="{{ $tour->title }}">
|
alt="{{ $tour->title }}">
|
||||||
@if($image->is_default)
|
@if($image->is_default)
|
||||||
<span
|
<span
|
||||||
class="badge bg-primary position-absolute top-0 start-0 m-1">اصلی</span>
|
class="badge bg-primary position-absolute top-0 start-0 m-1">اصلی</span>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@empty
|
@empty
|
||||||
|
|||||||
Reference in New Issue
Block a user