### Install Filament Right Click Package Source: https://github.com/leek/filament-right-click/blob/main/README.md Install the package using Composer and publish Filament assets. This is the initial setup step for enabling right-click functionality. ```bash composer require leek/filament-right-click php artisan filament:assets ``` -------------------------------- ### Configure Table Context Menu Actions Source: https://github.com/leek/filament-right-click/blob/main/README.md Define single-record and bulk context menu actions for Filament table rows. Use `contextMenuActions` for individual rows and `contextMenuBulkActions` for selected rows. Actions are wrapped using `ContextMenuItem`. ```php use Filament\Actions\Action; use Filament\Actions\BulkAction; use Filament\Actions\DeleteAction; use Filament\Support\Icons\Heroicon; use Filament\Tables\Table; use Leek\FilamentRightClick\Menu\ContextMenuItem; use Leek\FilamentRightClick\Menu\ContextMenuSection; use Leek\FilamentRightClick\Menu\ContextMenuSeparator; public static function table(Table $table): Table { return $table ->columns([ // ... ]) ->contextMenuActions([ ContextMenuSection::make([ ContextMenuItem::for( Action::make('archive') ->requiresConfirmation() ->action(fn ($record) => $record->archive()), ) ->label('Archive') ->icon(Heroicon::ArchiveBox) ->color('warning'), ])->label('Manage'), ContextMenuSeparator::make(), ContextMenuItem::for(DeleteAction::make()) ->label('Delete') ->icon(Heroicon::Trash) ->color('danger'), ]) ->contextMenuBulkActions([ ContextMenuItem::forBulkAction( BulkAction::make('archiveSelected') ->label('Archive Selected') ->requiresConfirmation() ->action(fn ($records) => $records->each->archive()), ) ->icon(Heroicon::ArchiveBox) ->color('warning'); ]); } ``` -------------------------------- ### Configure Flowforge Card Context Menu Actions Source: https://github.com/leek/filament-right-click/blob/main/README.md Add custom context menu actions to Flowforge Kanban board cards. These actions are defined using `contextMenuCardActions` and `ContextMenuItem` for individual card interactions. ```php use Filament\Actions\Action; use Filament\Support\Icons\Heroicon; use Leek\FilamentRightClick\Menu\ContextMenuItem; use Relaticle\Flowforge\Board; public function board(Board $board): Board { return $board ->query(Task::query()) ->columns([ // ... ]) ->recordActions([ // Visible card actions... ]) ->contextMenuCardActions([ ContextMenuItem::for( Action::make('viewTask') ->label('View Task') ->action(fn ($record) => $this->viewTask($record)), ) ->icon(Heroicon::Eye), ContextMenuItem::for( Action::make('archiveTask') ->requiresConfirmation() ->action(fn ($record) => $record->archive()), ) ->label('Archive') ->icon(Heroicon::ArchiveBox) ->color('warning'), ]); } ``` -------------------------------- ### Add Bulk Actions to Table Source: https://github.com/leek/filament-right-click/blob/main/README.md Use `contextMenuBulkActions()` with `ContextMenuItem::forBulkAction()` to define bulk actions for your Filament table. Ensure the `BulkAction` is configured with a label and an action closure. The color can be set on the `ContextMenuItem`. ```php use Filament\Actions\BulkAction; use Leek\FilamentRightClick\Menu\ContextMenuItem; $table->contextMenuBulkActions([ ContextMenuItem::forBulkAction( BulkAction::make('deleteSelected') ->label('Delete Selected') ->requiresConfirmation() ->action(fn ($records) => $records->each->delete()), ) ->color('danger'), ]); ``` -------------------------------- ### Register Filament Right Click Plugin Source: https://github.com/leek/filament-right-click/blob/main/README.md Register the FilamentRightClickPlugin with your Filament panel to enable its features. This code should be placed in your panel's configuration. ```php use Leek\FilamentRightClick\FilamentRightClickPlugin; $panel ->plugin(FilamentRightClickPlugin::make()); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.