feat: add user favorites functionality
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user