laravel-likeable icon indicating copy to clipboard operation
laravel-likeable copied to clipboard

Is there any way of getting global likes as a list for all models in created_at order

Open kgrosvenor opened this issue 8 years ago • 2 comments

so i want to display something like

Kieran liked users post "Postname" Kieran liked users comment "Comment"

How?

kgrosvenor avatar Feb 03 '17 16:02 kgrosvenor

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.

enourinick avatar Oct 17 '17 09:10 enourinick

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);

Evilran avatar Apr 23 '20 20:04 Evilran