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

Field dependsOn #28

Open
jjjrmy opened this issue Jun 11, 2022 · 3 comments
Open

Field dependsOn #28

jjjrmy opened this issue Jun 11, 2022 · 3 comments

Comments

@jjjrmy
Copy link

jjjrmy commented Jun 11, 2022

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
Copy link
Member

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

@ObaydaAlesawi
Copy link

@jjjrmy Did you get any solution here?

@Norgul
Copy link

Norgul commented Jul 17, 2024

Made a pull request for this feature (#61), please let me know if there is something failing and/or missing.

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

4 participants