public function getUserActivity($user, $limit = null, $name = null)
    {
        $user = $this->getUserId($user);

        $modelName = $this->getModelName();

        $activity = $modelName::belongsToUser($user);

        if ( ! is_null($limit))
        {
            $activity->limit($limit);
        }

        if ($name)
        {
            if ( ! is_array($name))
            {
                $name = [$name];
            }

            $activity->whereIn('name', $name);
        }

        return $activity->latest()->get();
    }
public function getUserActivity($user, $limit = null, $name = null)
    {
        $user = $this->getUserId($user);

        $modelName = $this->getModelName();

        $activity = $modelName::belongsToUser($user);

        if ( ! is_null($limit))
        {
            $activity->limit($limit);
        }

        if ($name)
        {
            if ( ! is_array($name))
            {
                $name = [$name];
            }

            $activity->whereIn('name', $name);
        }

        return $activity->latest()->get();
    }
public function getUserActivity ( $ user , $ limit = null , $ name = null ) { $ user = $ this -> getUserId ( $ user ) ; $ modelName = $ this -> getModelName ( ) ; $ activity = $ modelName :: belongsToUser ( $ user ) ; if ( ! is_null ( $ limit ) ) { $ activity -> limit ( $ limit ) ; } if ( $ name ) { if ( ! is_array ( $ name ) ) { $ name = [ $ name ] ; } $ activity -> whereIn ( 'name' , $ name ) ; } return $ activity -> latest ( ) -> get ( ) ; }
Getter for a users activity

@param Model|int $user
@param int|null $limit
@param array|string|null $name
@return Collection
Getter for a users activity