public function makeCollection(array $values, $class = null)
    {
        $collection = new Collection($values);
    
        if (!is_null($class) && class_exists($class)) {
            $model = new $class();
        
            if ($model instanceof Model) {
                foreach ($collection as $key => $item) {
                    $collection[$key] = $model->newInstance($item);
                }
            }
        }
    
        return $collection;
    }