0

Is there a way to create a Select-Field with other models? For example User::all()?

Workaround: Select Field

In the app I would like to select from available Users:

Laravel Nova: Select Users

4

1 回答 1

6

Just do this:

BelongsTo::make('Client')

or even better this:

BelongsTo::make('Client')->searchable()

If you want the labels then you can overwrite the label like so:

BelongsTo::make('Client')->displayUsing(function ($name) { return strtoupper($name); })

于 2018-10-30T09:55:23.080 回答