We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First of all, thanks for sharing this great package!
Is the SelectPlus field compatible with Nova Actions?
I have a simple Nova Action for updating a manytomany relation on a model:
class UpdateConsortia extends Action { use InteractsWithQueue, Queueable; /** * Perform the action on the given models. * * @param \Laravel\Nova\Fields\ActionFields $fields * @param \Illuminate\Support\Collection $models * @return mixed */ public function handle(ActionFields $fields, Collection $models) { foreach ($models as $model) { $model->consortia()->sync($fields->consortia); $model->save(); } } /** * Get the fields available on the action. * * @param \Laravel\Nova\Http\Requests\NovaRequest $request * @return array */ public function fields(NovaRequest $request) { $consortia = Consortium::pluck('id', 'name'); $formattedConsortia = $consortia->mapWithKeys(function ($id, $name) { return [$id => ['label' => $name]]; }); return [ MultiSelect::make('Consortia')->options($formattedConsortia)->displayUsingLabels(), ]; } }
I'd like to swap the MultiSelect field for a SelectPlus field like this:
public function fields(NovaRequest $request) { return [ SelectPlus::make('Consortia', 'consortia', Consortium::class) ->usingDetailLabel('name') ->label(fn ($consortium) => $consortium->name . "") ]; }
However, although the field renders fine $fields->consortia always returns null. The exact same field works fine used directly on the resource page.
$fields->consortia
null
The text was updated successfully, but these errors were encountered:
No branches or pull requests
First of all, thanks for sharing this great package!
Is the SelectPlus field compatible with Nova Actions?
I have a simple Nova Action for updating a manytomany relation on a model:
I'd like to swap the MultiSelect field for a SelectPlus field like this:
However, although the field renders fine
$fields->consortia
always returnsnull
. The exact same field works fine used directly on the resource page.The text was updated successfully, but these errors were encountered: