git add .

git commit  "add tours pages, components and show views"
This commit is contained in:
2026-08-17 11:36:19 +03:30
parent e99c340f1e
commit 970786ae94
15 changed files with 595 additions and 249 deletions
+10 -5
View File
@@ -6,19 +6,24 @@ use App\Models\Tour;
class TourController extends Controller
{
// صفحه لیست تورها: اسلایدر آخرین‌ها + گرید صفحه‌بندی‌شده
public function index()
{
$newestTour = Tour::latest()->take(10)->get();
$tours = Tour::latest()->paginate(9);
$newestTour = Tour::with('travelType')
->latest()
->take(10)
->get();
$tours = Tour::with('travelType')
->latest()
->paginate(5);
return view('tours.index', compact('newestTour', 'tours'));
}
// جزئیات تور + شمارنده بازدید
public function show(Tour $tour)
{
$tour->increment('views');
$tour->load('travelType');
return view('tours.show', compact('tour'));
}