diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 651f37e7f..f04291151 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -403,7 +403,7 @@ public function castPropertiesType($model) $realType = $this->getTypeOverride($realType); $this->properties[$name]['type'] = $this->getTypeInModel($model, $realType); - if (isset($this->nullableColumns[$name])) { + if (isset($this->nullableColumns[$name]) && $this->properties[$name]['type']) { $this->properties[$name]['type'] .= '|null'; } }