fix: dynamic tours details view and null-safe relations

This commit is contained in:
2026-08-18 14:55:47 +03:30
parent d427d8cf50
commit a2b9e3a051
6 changed files with 367 additions and 39 deletions
+3 -2
View File
@@ -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'));
}
}