award = $award; } /** * Add the award to this user, if they don't already have it * @param User $user * @return bool */ public function addAward(User $user) { $w = [ 'user_id' => $user->id, 'award_id' => $this->award->id ]; $found = UserAward::where($w)->count('id'); if($found > 0) { return true; } // Associate this award to the user now $award = new UserAward($w); $award->save(); } /** * Each award class just needs to award * @param User $user * @return mixed */ public function check(User $user) { return false; } }