-
Notifications
You must be signed in to change notification settings - Fork 67
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
Need help assigning points to a user #22
Comments
Share your ProjectCreated point class |
Thanks for your prompt reply. My ProjectCreated class is as follows:
|
make sure // Creates the project
$project = Project::create($attributes);
// Rewards points
givePoint(new ProjectCreated($project->fresh())); |
Hey, @saqueib, The problem is when calling the method The expected behaviour in this situation is to give the points to the user on which the givePoint methond has been executed. |
Hey @saqueib, Thanks for your reply. I have figured out the issue with my case which is that my Project model has a method called owner() instead of user(). By changing from owner() to user(), it works now. For the benefit of others who might be facing the same error message, ensure that your model has the user() method as such: Project Model:
|
I must agreee with you @walidbagh . How can I achieve that, please (even by writing a custom PointType class). Thanks! |
Hi there,
Thanks for sharing this great package!
I'm having some difficulties trying to assign points to user, here's a snippet of my code:
However, I'm getting the following error:
payee() method must return a model which will get the points.
Could you advise me on this?
The text was updated successfully, but these errors were encountered: