I have installed your package and added $user = User::first(); $user->toggleFavorite($article); in the articleshow method.
How to create a icon in the view blade file so that when a user clicks on it the logged in user is added to favorites count of the post and when the user clicks it again, he is removed from the favorites count of that article.
I see that there are $user->addFavorite($article); and $user->removeFavorite($article); But how to use them in the controller to gain the functionality i mentioned
I have installed your package and added $user = User::first(); $user->toggleFavorite($article); in the articleshow method.
How to create a icon in the view blade file so that when a user clicks on it the logged in user is added to favorites count of the post and when the user clicks it again, he is removed from the favorites count of that article.
I see that there are $user->addFavorite($article); and $user->removeFavorite($article); But how to use them in the controller to gain the functionality i mentioned