laravel-gamify icon indicating copy to clipboard operation
laravel-gamify copied to clipboard

Payee is not getting the user parameter

Open ghost opened this issue 4 years ago • 3 comments

Payee is not getting the user parameter

This is my function

undoPoint(new PraiseCreated($praise, $this->task->user));

Even though I pass $this->task->user the helper function is getting the authed user, so the points are going to the authed user instead of target user.

I found it by dumping dd($this->getSubject()->user); in PraiseCreated Class

ghost avatar Jul 22 '20 06:07 ghost

/cc @saqueib

ghost avatar Jul 22 '20 06:07 ghost

$this->task->user->undoPoint(new PraiseCreated($praise));

where is $this coming from? Are you calling from inside a model?

felix2056 avatar Jul 22 '20 21:07 felix2056

@ghost can you share PraiseCreated implementation

saqueib avatar Aug 03 '20 00:08 saqueib