diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 95a7b2f49..7d684b613 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -435,9 +435,11 @@ protected function getPropertiesFromTable($model) if (!$column->getNotnull()) { $this->nullableColumns[$name] = true; } + + $propertyType = $this->getTypeInModel($model, $type); $this->setProperty( $name, - $this->getTypeInModel($model, $type), + $propertyType, true, true, $comment, @@ -449,7 +451,7 @@ protected function getPropertiesFromTable($model) $this->getClassNameInModel($model, \Illuminate\Database\Eloquent\Builder::class) . '|' . $this->getClassNameInModel($model, get_class($model)), - array('$value') + array(empty($propertyType) ? '$value' : "{$propertyType} \$value") ); } }