### Install Filament Hidden Action via Composer Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/README.md Install the package via Composer. Requires PHP 8.2 or higher and Filament 5.0. ```bash composer require jeffersongoncalves/filament-hidden-action ``` -------------------------------- ### HiddenAction class extending Filament\Actions\Action Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Defines the HiddenAction class that overrides the default view and passes an MD5-hashed action name to the view. The setUp() method sets the default view to 'filament-hidden-action::components.hidden'. All parent Action methods remain available. ```php namespace JeffersonGoncalves\Filament\HiddenAction; use Filament\Actions\Action; class HiddenAction extends Action { protected function setUp(): void { parent::setUp(); $this->defaultView('filament-hidden-action::components.hidden'); } public function getExtraViewData(): array { return [ 'name' => md5($this->getName()), ]; } } ``` -------------------------------- ### Run Static Analysis and Format Code Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/README.md Development commands for static analysis and code formatting. ```bash # Run static analysis composer analyse # Format code composer format ``` -------------------------------- ### HiddenActionServiceProvider registering views Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Service provider that extends Spatie's PackageServiceProvider and configures the package to only register views. No config, migrations, or translations are included. ```php namespace JeffersonGoncalves\Filament\HiddenAction; use Spatie\LaravelPackageTools\Package; use Spatie\LaravelPackageTools\PackageServiceProvider; class HiddenActionServiceProvider extends PackageServiceProvider { public function configurePackage(Package $package): void { $package->name('filament-hidden-action') ->hasViews(); } } ``` -------------------------------- ### Hidden action in form actions with key binding Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Creates a HiddenAction for form contexts, with a mod+shift+f key binding and auto-fill logic. Must be registered where Filament processes actions. ```php use JeffersonGoncalves\Filament\HiddenAction\HiddenAction; HiddenAction::make('auto-fill') ->keyBindings(['mod+shift+f']) ->action(function ($component) { // Auto-fill logic }); ``` -------------------------------- ### Create a HiddenAction in Filament Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/README.md Define a hidden action that is not rendered in the UI but can be triggered programmatically or via keyboard shortcuts. Use it like any other Filament Action. ```php use JeffersonGoncalves\Filament\HiddenAction\HiddenAction; HiddenAction::make('hidden-action') ->action(function () { // Your logic here }); ``` -------------------------------- ### HiddenAction with confirmation modal Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Adds a confirmation modal to a hidden action triggered by mod+shift+d. The action will not execute until the user confirms. ```php use JeffersonGoncalves\Filament\HiddenAction\HiddenAction; HiddenAction::make('dangerous-action') ->keyBindings(['mod+shift+d']) ->requiresConfirmation() ->action(function () { // Dangerous logic }); ``` -------------------------------- ### HiddenAction with keyboard shortcut Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Adds a keyboard shortcut (mod+s) to a hidden action. The action remains invisible but can be triggered via the key binding. ```php use JeffersonGoncalves\Filament\HiddenAction\HiddenAction; HiddenAction::make('quick-save') ->keyBindings(['mod+s']) ->action(function () { // Save logic }); ``` -------------------------------- ### Hidden action in page header with key binding Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Registers a HiddenAction in getHeaderActions with a keyboard shortcut mod+r to trigger a refresh method. Must be used within a page's header actions array. ```php use JeffersonGoncalves\Filament\HiddenAction\HiddenAction; protected function getHeaderActions(): array { return [ HiddenAction::make('refresh-data') ->keyBindings(['mod+r']) ->action(fn () => $this->refreshData()), ]; } ``` -------------------------------- ### Hidden Blade view rendering an HTML comment Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Blade view that renders only an HTML comment with the MD5-hashed action name. This makes the action present in the DOM for Filament's JavaScript to wire up while remaining invisible to the user. ```blade @props(['name' => null]) ``` -------------------------------- ### Hidden action in table actions Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Adds a HiddenAction to a Filament table's actions array with a closure that receives the record, calling viewRecord. Registered in the table actions context. ```php use JeffersonGoncalves\Filament\HiddenAction\HiddenAction; $table->actions([ HiddenAction::make('quick-view') ->action(fn ($record) => $this->viewRecord($record)), ]); ``` -------------------------------- ### HiddenAction with form modal Source: https://github.com/jeffersongoncalves/filament-hidden-action/blob/2.x/resources/boost/skills/filament-hidden-action-development/SKILL.md Adds a form modal to a hidden action triggered by mod+n. The form data is passed to the action closure. ```php use JeffersonGoncalves\Filament\HiddenAction\HiddenAction; use Filament\Forms\Components\TextInput; HiddenAction::make('quick-note') ->keyBindings(['mod+n']) ->form([ TextInput::make('note') ->required(), ]) ->action(function (array $data) { // Handle form data }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.