fix: update tour management

This commit is contained in:
2026-08-17 19:53:12 +03:30
parent 81d2aa1acb
commit 123b43fb38
7 changed files with 358 additions and 29 deletions
+86 -3
View File
@@ -1,3 +1,86 @@
<div>
<!-- It is not the man who has too little, but the man who craves more, that is poor. - Seneca -->
</div>
@extends('admin.layouts.app')
@section('content')
<div class="container-fluid">
<div class="d-flex justify-content-between align-items-center mb-4">
<h4>ویرایش تور: {{ $tour->title }}</h4>
<a href="{{ route('admin.tours.index') }}" class="btn btn-secondary">بازگشت</a>
</div>
@if ($errors->any())
<div class="alert alert-danger">
<ul class="mb-0">
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="card border-0 shadow-sm">
<div class="card-body">
<form action="{{ route('admin.tours.update', $tour->id) }}" method="POST" enctype="multipart/form-data">
@csrf
@method('PUT')
<div class="row">
<!-- عنوان -->
<div class="col-md-6 mb-3">
<label class="form-label">عنوان تور</label>
<input type="text" name="title" class="form-control"
value="{{ old('title', $tour->title) }}" required>
</div>
<!-- نوع سفر -->
<div class="col-md-6 mb-3">
<label class="form-label">نوع سفر</label>
<select name="travel_type_id" class="form-select">
@foreach($travelTypes as $type)
<option
value="{{ $type->id }}" {{ $tour->travel_type_id == $type->id ? 'selected' : '' }}>
{{ $type->name }}
</option>
@endforeach
</select>
</div>
<!-- قیمت -->
<div class="col-md-4 mb-3">
<label class="form-label">قیمت (تومان)</label>
<input type="number" name="price" class="form-control"
value="{{ old('price', $tour->price) }}">
</div>
<!-- ظرفیت -->
<div class="col-md-4 mb-3">
<label class="form-label">ظرفیت</label>
<input type="number" name="capacity" class="form-control"
value="{{ old('capacity', $tour->capacity) }}">
</div>
<!-- وضعیت -->
<div class="col-md-4 mb-3">
<label class="form-label">وضعیت</label>
<select name="status" class="form-select">
<option value="0" {{ $tour->status == 0 ? 'selected' : '' }}>پیش‌نویس</option>
<option value="1" {{ $tour->status == 1 ? 'selected' : '' }}>فعال</option>
<option value="2" {{ $tour->status == 2 ? 'selected' : '' }}>منتشر شده</option>
</select>
</div>
<!-- توضیحات -->
<div class="col-12 mb-3">
<label class="form-label">توضیحات</label>
<textarea name="description" class="form-control"
rows="5">{{ old('description', $tour->description) }}</textarea>
</div>
</div>
<div class="d-flex justify-content-end">
<button type="submit" class="btn btn-primary px-4">ذخیره تغییرات</button>
</div>
</form>
</div>
</div>
</div>
@endsection