feat: add user favorites functionality

This commit is contained in:
2026-08-22 07:40:26 +03:30
parent b6a5d96098
commit 54575b2199
2 changed files with 31 additions and 4 deletions
+9
View File
@@ -43,6 +43,15 @@ class TourController extends Controller
]);
$tour->increment('views_count');
$isFavorite = false;
if (auth()->check()) {
$isFavorite = auth()->user()
->favoriteTours()
->where('tours.id', $tour->id)
->exists();
}
return view('tours.show', compact('title' , 'tour'));
}
public function commentStore(TourCommentStoreRequest $request, Tour $tour)