With the default Filament select, it is possible to have a single select (inside the modal) to attach relationships. Sadly, you can't attach multiple records with the default select.
Solving this is fairly easy, we'll take an AttachAction as example:
Tables\Actions\AttachAction::make()
Change this to:
Tables\Actions\AttachAction::make() ->recordSelect(function (Select $select) { return $select->multiple(); }),
Now, the AttachAction select is a multi-select.
Note: You need to
use Filament\Forms\Components\Select;
for this.Unfortunately this does not seem with more recent filament versions anymore. A MultiSelect is rendered but only one record can be selected at a time :(.
You are right. It does not work with the latest filament version.
Great feature, sad it's still not working on recent version. Is there a issue opened on Github already?
I can confirm this works for me on filamentphp v3 :-)
Works perfectly with version 3.0.94
Shorter version: