where('status', 1) ->with('file') ->orderByDesc('created_at') ->paginate(12); return view('tours.index', compact('tours')); } public function show(Tour $tour) { abort_if($tour->status !== TourStatus::ENABLE->value, 404); $tour->increment('views'); $tour->load(['file', 'comments' => function ($query) { $query->where('status', CommentStatus::APPROVED) ->with('user') ->orderByDesc('created_at'); },]); return view('tours.show', compact('tour')); } }