© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
JayAyAre

Remove options selected on a repeater form

i need remove the selected modules from the select, that is inside of a repeater

the code is actually that doesnot works is:

$modules = Module::query()->pluck('name', 'id')->toArray();
return $form
->schema([
Forms\Components\Repeater::make('Modules')
->schema([
Forms\Components\Select::make('modules')
->live()
->required()
->distinct()
->default('')
->options(function (callable $get) use ($modules) {
$repeater = collect($get('../../Modules'))->pluck('modules')->toArray() ?: [];
$idsToSkip = [];
if ($repeater !== null) {
foreach ($repeater as $module){
if (isset($module['modules'])){
$idsToSkip[] = $module['modules'];
}
}
}

$array = Module::query()->whereNotIn('id', $idsToSkip)->pluck('name', 'id')->toArray();
return $array;
}),
Forms\Components\TextInput::make('discount')
->label('Discount in %')
->live()
->numeric()
->minValue(0)
->maxValue(100)
->required()
->default(0)
])->columns(2)
selected'),
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Repeater remove selected option in a select
FilamentFFilament / ❓┊help
3y ago
Emit selected item on repeater items
FilamentFFilament / ❓┊help
3y ago
BulkAction options based on selected records.
FilamentFFilament / ❓┊help
2y ago
Displaying options base on selected value
FilamentFFilament / ❓┊help
3y ago