laravel-likeable
laravel-likeable copied to clipboard
Is there any way of getting global likes as a list for all models in created_at order
so i want to display something like
Kieran liked users post "Postname" Kieran liked users comment "Comment"
How?
As I understand from this package, you have two models, one of them (which contains relation between your model and users) named "Like" in the namespace of "Conner\Likeable", so you could act it like a normal model.
It just likes the official model.
Get data in "created_at" order:
$posts = Post::whereLikedBy($user->id)
->with('likeCounter')
->orderby('created_at', 'desc')
->paginate(30);