Skip to content

Commit

Permalink
Fixing bug to return referrer user id
Browse files Browse the repository at this point in the history
  • Loading branch information
melogail committed Oct 5, 2023
1 parent 5fd13d6 commit a007bd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/Traits/Referrerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function getReferrerIdFromReferralToken()
{
// Get referral token from query.
$referral_token = request()->hasCookie('referral_token') ? request()->cookie('referral_token') : null;
$user = $referral_token != null ? User::where('referral_token', $referral_token)->first('id') : null;
$user = $referral_token != null ? Referral::where('referral_token', $referral_token)->user->id : null;

return $user?->referrerId();
}
Expand Down

0 comments on commit a007bd7

Please sign in to comment.