From eac97d7f0ecd3184c3bd652144bec30f544f5712 Mon Sep 17 00:00:00 2001 From: Jordan Pickwell Date: Mon, 13 Jul 2020 15:09:32 -0500 Subject: [PATCH] Add model property types to magic where methods. --- src/Console/ModelsCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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") ); } }