public static function fromArray($array)
    {
        if (!is_array($array)) {
            throw new InvalidArgumentException("Expected array, got " . gettype($array));
        }

        $model = new static();

        foreach ($array as $key => $value) {
            if (property_exists($model, $key)) {
                $model->$key = $value;
            }
        }

        return $model;
    }