FilamentF
Filament3y ago
Gush

Allowing to attach duplicate records

in a belongtomany relationship how do i change the default behavior of not allowing to attach one record twice or more, i already read the docs but its limited and i really dont understand how
Solution
public function table(Table $table): Table
    {
        return $table
            ->recordTitle(fn (Equipment $record): string => "{$record->name}\n ({$record->equipmentbrands->name}, {$record->equipmentmodels->name}, {$record->equipmentcategories->name})")
            ->allowDuplicates() //here
            ->columns([
Was this page helpful?