$table->headerActions([
Tables\Actions\AttachAction::make()
->form(fn(AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\Select::make('training_session_id')
->options(
\App\Models\TrainingSession::where('training_id', $this->getOwnerRecord()->id)->pluck('name', 'id')
)
])
->action(
function (array $arguments, array $data, Form $form, Table $table, AttachAction $action): void {
$this->doAttach($arguments, $data, $form, $table, $action);
}
)
->attachAnother(false),
])
$table->headerActions([
Tables\Actions\AttachAction::make()
->form(fn(AttachAction $action): array => [
$action->getRecordSelect(),
Forms\Components\Select::make('training_session_id')
->options(
\App\Models\TrainingSession::where('training_id', $this->getOwnerRecord()->id)->pluck('name', 'id')
)
])
->action(
function (array $arguments, array $data, Form $form, Table $table, AttachAction $action): void {
$this->doAttach($arguments, $data, $form, $table, $action);
}
)
->attachAnother(false),
])