protected function addPointToUser($number, $beforePoint, $afterPoint)
    {
        if($this->pointNotIsset())
            $point = $this->createPointToUser();
       else
            $point = Point::where('user_id' ,$this->id)
                         ->where('rule_id' ,$this->ruleId)
                         ->first();

        $this->logPoint($point->id, $number, $beforePoint, $afterPoint);
        $point->number = $afterPoint;

        return $point->save();
    }
protected function addPointToUser($number, $beforePoint, $afterPoint)
    {
        if($this->pointNotIsset())
            $point = $this->createPointToUser();
       else
            $point = Point::where('user_id' ,$this->id)
                         ->where('rule_id' ,$this->ruleId)
                         ->first();

        $this->logPoint($point->id, $number, $beforePoint, $afterPoint);
        $point->number = $afterPoint;

        return $point->save();
    }
protected function addPointToUser ( $ number , $ beforePoint , $ afterPoint ) { if ( $ this -> pointNotIsset ( ) ) $ point = $ this -> createPointToUser ( ) ; else $ point = Point :: where ( 'user_id' , $ this -> id ) -> where ( 'rule_id' , $ this -> ruleId ) -> first ( ) ; $ this -> logPoint ( $ point -> id , $ number , $ beforePoint , $ afterPoint ) ; $ point -> number = $ afterPoint ; return $ point -> save ( ) ; }
update user point

@param int $ruleId
@param $number
@param $beforePoint
@param $afterPoint
@return mixed
update user point