Comments (3)
@code23-isaac They have to be separate queries since the relation beneath is morph.
from befriended.
There is an example for each case in the documentation. Basically, you can pass a parameter to the likes
with the class:
$user->likes(Page::class)->count();
See more about the liking examples
from befriended.
Is it possible to provide multiple classes to the likers()
method, or do these have to be separate queries?
Would be great to get back all the models of all types in one go
from befriended.
Related Issues (20)
- How to delete all likes related to a post when deleting post? HOT 2
- Encountering issues with MorphMap. Getting class "user" not found HOT 1
- Support for Laravel 10
- Cannot follow a Model HOT 1
- Getting a count for number of likers of a liked "Entry" HOT 2
- Allow for MorphMap relationships inside traits HOT 3
- [Feature Request] Could you add upvote/downvote features? HOT 4
- Minor versions shouldn't make incompatible API changes HOT 6
- No "remove followers" feature
- user unfollowing someone HOT 1
- Follow Request accept on the wrong side? HOT 1
- Unable to locate publishable resources HOT 1
- how to fetch my pending request? HOT 1
- how to get all dislikes for a specific topic? HOT 1
- using filterFollowingsOf, retrieve the requester data HOT 3
- using followedBy and unfollowedBy gives me an error
- Optimize the queries with eager loading HOT 9
- Most liked posts? HOT 2
- [bug] Can't follow models with MorphMap HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from befriended.