F
Filament7mo ago
NikkiP

Populating Repeater Select Dropdown

How can you populate a select dropdown inside a repeater based on the select dropdown outside the repeater. See attached screenshot. Thank you!
No description
Solution:
Passing an array into the repeater.. ```php ->live() ->afterStateUpdated(function($state, \Closure $get) { $set('myRepeater', SubjectsModel::find((int) $state)->toArray());...
Jump to solution
2 Replies
Solution
toeknee
toeknee7mo ago
Passing an array into the repeater..
->live()
->afterStateUpdated(function($state, \Closure $get) {
$set('myRepeater', SubjectsModel::find((int) $state)->toArray());
}
->live()
->afterStateUpdated(function($state, \Closure $get) {
$set('myRepeater', SubjectsModel::find((int) $state)->toArray());
}
should work, or your can do a built of an array from populating it and then settingn it as but the $set above
NikkiP
NikkiP7mo ago
thank you for the help! Much appreciated.