Skip to content
New issue

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

DependsOn: native field options don't work #63

Open
Keko-94 opened this issue Aug 21, 2023 · 0 comments
Open

DependsOn: native field options don't work #63

Keko-94 opened this issue Aug 21, 2023 · 0 comments

Comments

@Keko-94
Copy link

Keko-94 commented Aug 21, 2023

          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 #49 (comment)

@Keko-94 Keko-94 changed the title But still some native field options don't work, for example: DependsOn: native field options don't work Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant