diff --git a/app/Http/Controllers/TourController.php b/app/Http/Controllers/TourController.php index 0a6d242..f0d0eac 100644 --- a/app/Http/Controllers/TourController.php +++ b/app/Http/Controllers/TourController.php @@ -25,10 +25,11 @@ class TourController extends Controller return view('tours.index', compact('title', 'tours', 'sort')); } - public function show(Tour $id) + public function show(Tour $tour) { $title= 'جزئیات تور'; - $tour = Tour::findOrFail($id); + $tour->load(['file', 'originCity', 'city', 'tourDepartures', 'comments.user']); + return view('tours.show', compact('title' , 'tour')); } } diff --git a/resources/views/components/tour-card.blade.php b/resources/views/components/tour-card.blade.php index 7fea367..c3c698b 100644 --- a/resources/views/components/tour-card.blade.php +++ b/resources/views/components/tour-card.blade.php @@ -21,7 +21,7 @@ {{ number_format(optional($tour->tourDepartures->first())->price ?? 0) }} تومان
- نمایش جزئیات + نمایش جزئیات
diff --git a/resources/views/tours/partials/main.blade.php b/resources/views/tours/partials/main.blade.php index d6afed8..c45332e 100644 --- a/resources/views/tours/partials/main.blade.php +++ b/resources/views/tours/partials/main.blade.php @@ -1,52 +1,269 @@ -{{-- resources/views/flights/partials/main_content.blade.php --}}
-
-

نیویورک - لس آنجلس

-

سفر یک طرفه 1 توقف

-
-
- 5.0 - عالی - (2 هزار بازخورد) +

{{ $tour->originCity?->name }} - {{ $tour->city?->name }}

+

سفر {{ $tour->tour_type }}

+ @php + $departure = $tour->tourDepartures->first(); + @endphp
- +
+
+
+ +
+
+
شروع حرکت
+

+ {{ $departure && $departure->start_date ? Verta::instance($departure->start_date)->format('Y/m/d - H:i') : 'نامشخص' }} +

+
+
+
+
+ +
+
+
پایان سفر
+

+ {{ $departure && $departure->end_date ? Verta::instance($departure->end_date)->format('Y/m/d - H:i') : 'نامشخص' }} +

+
+
+
+
+
+
+
+
+ +
+
+
نوع تور
+ {{ $tour->tour_type ?? 'نامشخص' }} +
+
+
+
+
+
+ +
+
+
ظرفیت
+ {{ $departure ? $departure->capacity . ' نفر' : 'تکمیل شده' }} +
+
+
+
+
+
+ +
+
+
قیمت هر نفر
+ {{ $departure ? number_format($departure->price) . ' تومان' : 'نامشخص' }} +
+
+
+
+
-
-

نظرات

-
-

نظر بدهید

-
-
-
-
- -
-
-
-
- -
+
+

درباره {{ $tour->title }}

+

{{ $tour->description ?? $tour->summary }}

+
+ +
+

ویژگی های هنگام سفر

+
+
+
+
+
وای فای
-
- +
+
+
تلویزیون
+
- - +
+
+
سرگرمی
+
+
+
+
+
قهوه
+
+
+
+
+
تهویه مطبوع
+
+
+
+
+
غذا
+
+
+
+
+
بازی ها
+
+
+
+
+
شربت ها
+
+
+
+
+
راحتی
+
+
+
+
+
مجلات
+
+
+
+
+
+ +
+

بررسی ها

+
+
+
نظرات کاربران
+ @forelse ($tour->comments as $comment) +
+
+ user +
+
+
{{ $comment->guest_name ?? $comment->user?->first_name }}
+ {{ Verta::instance($comment->created_at)->formatDifference() }} +
+
+
+

{{ $comment->content }}

+
+ @empty +

هنوز نظری برای این تور ثبت نشده است.

+ @endforelse +
+ +
+ @if (session('success')) +
+ {{ session('success') }} +
+ @endif + + @if (session('error')) +
+ {{ session('error') }} +
+ @endif + + @if ($errors->any()) +
+
    + @foreach ($errors->all() as $error) +
  • {{ $error }}
  • + @endforeach +
+
+ @endif + +

نظر بدهید

+
+ @csrf + + @auth +
+
+
+ +
+
+
+
+ +
+
+
+ @else +
+
+
+ + @error('guest_name') + {{$message}} + @enderror +
+
+
+
+ + @error('guest_email') + {{$message}} + @enderror +
+
+
+ @endauth + +
+ + @error('content') + {{$message}} + @enderror +
+ + +
+
diff --git a/resources/views/tours/partials/sidebar.blade.php b/resources/views/tours/partials/sidebar.blade.php new file mode 100644 index 0000000..b6d1455 --- /dev/null +++ b/resources/views/tours/partials/sidebar.blade.php @@ -0,0 +1,73 @@ +
+
+
+

تور

+
+ {{ number_format($tour->price) }} تومان +
+
+ + @php + $departure = $tour->tourDepartures->first(); + @endphp + +
+
+ @csrf + + +
+
+
+
+
+ + +
+
+
+ +
+
+
+
+ + +
+
+
+
+
+ +
+ + + + افزودن به علاقه مندی ها + +
+
+
+
+ +
+ اشتراک + 250 مشاهده +
+
+
diff --git a/resources/views/tours/show.blade.php b/resources/views/tours/show.blade.php index 2466e19..e1fa5e8 100644 --- a/resources/views/tours/show.blade.php +++ b/resources/views/tours/show.blade.php @@ -1,3 +1,36 @@ -
- -
+@extends('layouts.app') + + +@section('content') +
+ + + +
+
+
+
+ +
+ @include('tours.partials.main') +
+ +
+ @include('tours.partials.sidebar') +
+ +
+
+
+
+ +
+@endsection diff --git a/routes/web.php b/routes/web.php index c5292d2..63fa070 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,7 +23,11 @@ Route::prefix('flights')->controller(FlightController::class)->name('flights.')- Route::prefix('tours')->controller(TourController::class)->name('tours.')->group(function () { Route::get('/', 'index')->name('index'); - Route::get('{tour}', 'show')->name('show'); + Route::prefix('{tour}')->group(function () { + Route::get('/', 'show')->name('show'); + Route::post('/comment', 'commentStore')->name('comments.store'); + Route::post('/booking', [BookingController::class, 'store'])->name('booking.store'); + }); });