1

I am going to show a livewire component in modal window when user clicks a filament table action.

    protected function getTableActions()
    {
        return [
            ActionGroup::make([
                ViewAction::make()->form([
                    TextInput::make('name'),
                    TextInput::make('email'),
                ]),
                DeleteAction::make(),
                ForceDeleteAction::make(),
                RestoreAction::make(),
                Action::make('assign')
                    ->icon('heroicon-o-trash')
            ])
        ];
    }

When clicked assign button, I want to show a modal window and the use a livewire component as modal window content. I tried to find the solution and looked around filament table actin docs, but I couldn't find. Please help me to find what functions to call for making custom filament table action for showing a livewire component in modal window.

I tried to call like this but this is the only view. I want to use a full livewire component.

    protected function getTableActions()
    {
        return [
            ActionGroup::make([
                ViewAction::make()->form([
                    TextInput::make('name'),
                    TextInput::make('email'),
                ]),
                DeleteAction::make(),
                ForceDeleteAction::make(),
                RestoreAction::make(),
                Action::make('assign')
                    ->icon('heroicon-o-trash')
                    ->action(fn () => $this->record->advance())
                    ->modalFooter(view('livewire.assign-course'))
            ])
        ];
    }

0 Answers0