diff --git a/src/Phaseolies/Database/Entity/Query/InteractsWithModelQueryProcessing.php b/src/Phaseolies/Database/Entity/Query/InteractsWithModelQueryProcessing.php index 0c532b0..2eaef44 100644 --- a/src/Phaseolies/Database/Entity/Query/InteractsWithModelQueryProcessing.php +++ b/src/Phaseolies/Database/Entity/Query/InteractsWithModelQueryProcessing.php @@ -422,6 +422,12 @@ public static function createFromModel(Model $model): static */ protected function getCreatableAttributes(): array { + if (empty($this->creatable)) { + throw new \RuntimeException( + "Model " . static::class . " has no \$creatable attributes defined." + ); + } + $creatableAttributes = []; foreach ($this->creatable as $attribute) { if (isset($this->attributes[$attribute])) {