outl1ne / nova-simple-repeatable

A Laravel Nova simple repeatable rows field.
MIT License
73 stars 42 forks source link

Field dependsOn #28

Open jjjrmy opened 2 years ago

jjjrmy commented 2 years ago

I'd like to do something like this, but it doesn't seem to trigger anything...

SimpleRepeatable::make('Theme Templates', 'templates', [
    Select::make('Theme', 'theme_id')->displayUsingLabels()
        ->options(fn() => $this->team->themes->pluck('name','id')),
    Select::make('Template')
        ->dependsOn(['theme_id'],
            function (Select $field, NovaRequest $request, FormData $formData) {
                $field->options(Theme::find($formData->theme_id)->templates);
            }
        )
])->stacked(),
KasparRosin commented 1 year ago

Depending on a sibling fields inside SimpleRepeatable is not yet supported like so. Pull requests are welcome.

ObaydaAlesawi commented 1 year ago

@jjjrmy Did you get any solution here?

Norgul commented 2 months ago

Made a pull request for this feature (https://github.com/outl1ne/nova-simple-repeatable/pull/61), please let me know if there is something failing and/or missing.