nova-select-plus icon indicating copy to clipboard operation
nova-select-plus copied to clipboard

DependsOn: native field options don't work

Open Keko-94 opened this issue 1 year ago • 1 comments

          But still some native field options don't work, for example:
SelectPlus::make('Product Varieties', 'productVarieties', ProductVariety::class)
    ->usingDetailLabel('name')
    ->resolveUsing(fn($models) => $models->sortBy('pivot.order')->values())
    ->reorderable('order')
    ->required()
    ->onlyOnForms()
    ->dependsOn('productType', function (SelectPlus $field, NovaRequest $request, FormData $formData) {
        if (!$formData->productType) {
           $field->show();
        } else {
          $field->hide();
       }
    })

I would like to be able to add for example: ->required() or disable it depending on the other field. On all others basic Nova Fields all this methods work as they should.

Originally posted by @Bibesko in https://github.com/ziffmedia/nova-select-plus/issues/49#issuecomment-1523327866

Keko-94 avatar Aug 21 '23 08:08 Keko-94