git add .
git commit "add tours pages, components and show views"
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user