laravel-acquaintances
laravel-acquaintances copied to clipboard
The method popular does not exist on InteractionRelation as documented
Do i miss something here? To me it seems, like a wrong documentation.
Perhaps you are checking a different/old version?
Because as you can see it's there: https://github.com/multicaret/laravel-acquaintances/blob/eef71ca743c6a69577bf95cbe0034e47f19f4943/src/Models/InteractionRelation.php#L53
I will give it a try later, code-wise, in order to reproduce this issue.
Where is the static method that is documented for a Trait ?
$posts = App\Post::popular()->get();
Please provide the used traits within your Post
model
@jwjuele It seems to me that your question has been answered but please do feel free to elaborate on your issue if it wasn't. Otherwise, you can go ahead and close it,
Just to be sure we're on the same page here, the method you sent is not a static method. It is a local scope, the same one that @mkwsra has mentioned, which goes by scopePopular
within the model. What I understood is that you are looking for a function named popular(...)
but do correct me if I'm wrong.
I'm using an Article model with the trait "canBeFavorited", but I also tried "canBeLiked".
My goal is to query the most popular Articles. As there is a static method called "Post::popular()" documented in the ReadMe, I assumed, that i could use it on my Article Model.
When I received an error, I took a look into the source code and could not find any definition of this documented method.
-
So, if this method does not exist within these both traits, which traits do include it?
-
if this the method which should be used Is called "scopePopular", how do I use it, and why isn't it part of the docs?