Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kgrosvenor opened this issue Feb 3, 2017 · 2 comments

Comments

@kgrosvenor
Copy link

so i want to display something like

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

How?

@enourinick
Copy link

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.

@Evilran
Copy link

Evilran commented Apr 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants