Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add model property types to magic where methods.
Browse files Browse the repository at this point in the history
jpickwell authored Jul 13, 2020
1 parent 6cb0201 commit eac97d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
@@ -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")
);
}
}

0 comments on commit eac97d7

Please sign in to comment.