mirror of
https://github.com/archtechx/airwire.git
synced 2025-12-12 02:34:04 +00:00
first()?
This commit is contained in:
parent
f5fc60f4bc
commit
1bbc27230f
1 changed files with 1 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ class TypehintConverter
|
|||
$this->namedTypes[$alias] = 'pending'; // We do this to avoid infinite loops when recursively generating model type definitions
|
||||
|
||||
$values = $model->toArray()
|
||||
?: $model->first()->toArray() // If this model is empty, attempt finding the first one in the DB
|
||||
?: $model->first()?->toArray() // If this model is empty, attempt finding the first one in the DB
|
||||
?: collect(Schema::getColumnListing($model->getTable()))->mapWithKeys(fn (string $column) => [$column => []])->toArray(); // [] for any
|
||||
|
||||
$this->namedTypes[$alias] = '{ ' .
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue