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

payee() method must return a model which will get the points #39

Open
kylemabaso opened this issue Oct 3, 2020 · 3 comments
Open

payee() method must return a model which will get the points #39

kylemabaso opened this issue Oct 3, 2020 · 3 comments

Comments

@kylemabaso
Copy link

Hi Guys. I keep getting an error that says QCod\Gamify\Exceptions\InvalidPayeeModel payee() method must return a model which will get the points.

Config file:

payee_model' => '\App\Models\User

LeadCreated

    public function payee()
    {
        return $this->getSubject()->user;
    }

Lead Controller

        $lead = Lead::create([
            'first_name' => $postData['first_name'],
            'last_name' => $postData['last_name'],
        ]);

        $user = $request->user();
        $user->givePoint(new LeadCreated($lead));
@msulaimanmisri
Copy link

@kylemabaso , hey. Hope this will still help you.

Remove user on your public function payee().

Then use this givePoint(new LeadCreated($user));

@burasuk
Copy link

burasuk commented Sep 16, 2022

same here, if i remove user from payee method, i've got another error:
Call to undefined method App\Models\ModelName::reputations()

@msulaimanmisri
Copy link

I found other bugs when using this package. End up, I develop my own gamification package. Even though take a little bit of time, it works like what I want.

This package is great though.

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