Skip to content

Load option of BelongTo field based on BelongTo select value #1339

Closed Answered by benjy8001
benjy8001 asked this question in Q&A
Discussion options

You must be logged in to vote

Resolve by using ->associatedWith

Exemple :

            BelongsTo::make(__('moonshine::ui.resource.makes.label'), relationName: 'carMake')
                ->required()
                ->searchable()
                ->sortable(),
            BelongsTo::make(__('moonshine::ui.resource.models.label'), relationName: 'carModel')
                ->associatedWith('car_make_id')
                ->required()
                ->searchable()
                ->sortable(),

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@benjy8001
Comment options

@lee-to
Comment options

@benjy8001
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by benjy8001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants