public static function of($builder)
    {
        if ($builder instanceof \Illuminate\Database\Eloquent\Builder) {
            $builder = $builder->getQuery();
        }

        $collection = new Collection($builder);
        $collection = self::_addCustomAttributes($collection);
        self::$_lastCollection = $collection;
        return self::collection();
    }