Phosphorum\Badges\BadgeBase::add PHP Method

add() public method

Add the badge to the user
public add ( Users $user, array $extra = null )
$user Phosphorum\Models\Users
$extra array
    public function add(Users $user, $extra = null)
    {
        $userBadge = new UsersBadges();
        $userBadge->users_id = $user->id;
        $userBadge->badge = $this->getName();
        $userBadge->save();
        return $this;
    }