- How do I install aymanalhattami/filament-context-menu in Laravel?
- Install it via Composer with composer require aymanalhattami/filament-context-menu, choosing the package version that matches your Filament major version. Then add the PageHasContextMenu trait to the Filament page classes where you want right-click menus and implement getContextMenuActions(). For table cells, swap in the provided context-menu-aware column classes. No migrations or extra services are required.
- Which version of aymanalhattami/filament-context-menu supports Filament 3, 4, or 5?
- Version 1 targets Filament 3, version 2 targets Filament 4, and version 3 targets Filament 5. Pin the package version explicitly in Composer to match your admin panel's Filament major version. Check Composer constraints for PHP and Laravel compatibility before rollout.
- How do I add a right-click context menu to a Filament resource page?
- Add the PageHasContextMenu trait to the resource page class and implement getContextMenuActions() to return an array of Filament Actions. The package hooks into Filament's page lifecycle and renders the menu on right-click. You can include prebuilt actions such as Create, Edit, View, Delete, and Replicate, plus dividers between items.
- How do I add a context menu to Filament table cells?
- Use the package's context-menu-aware column classes, such as ContextMenuTextColumn, in place of the standard Filament table columns. These drop-in column variants expose right-click menus for table rows and cells. You define the actions in the same Filament Actions style used elsewhere in the package.
- Can I use Filament Actions such as Edit, Delete, and View in the context menu?
- Yes. The package is built on Filament Actions, so menu items are defined as Filament Actions. The README documents common prebuilt actions including Create, Edit, View, Delete, Replicate, ForceDelete, Restore, Import, and Export, as well as modal actions and dividers. Because actions remain Filament actions, your existing visibility and authorization configuration still applies.
- How do I enable or disable the context menu globally or per page?
- Enable or disable globally with the CONTEXT_MENU_ENABLED environment setting. Per page, use the static property or the isContextMenuEnabled() method to control whether the menu is active. This is useful for progressive rollout or as a kill switch in non-production environments.
- Does filament-context-menu support dark mode, RTL, and dividers?
- Yes. The context menus support dark and light modes and left-to-right and right-to-left direction. You can add dividers between menu actions. These are documented as built-in features of the package.
- Do context menu actions respect Filament policies and visible() checks?
- The package delegates menu items to Filament Actions, so authorization still depends on your host application's policies and action visibility configuration. The package does not remove the need to configure visible(), authorize(), or policy checks correctly. Review each action exposed in a context menu to ensure it is properly guarded.
- Can I add Refresh, Go Back, and Go Forward actions to a Filament context menu?
- Yes. The package provides RefreshAction, GoBackAction, and GoForwardAction for use in page context menus. RefreshAction reloads the page, GoBackAction goes to the previous page, and GoForwardAction goes forward. You can combine these built-in actions with your own Filament Actions in the same menu.
- Is filament-context-menu production-ready and what are the maintenance risks?
- The package has limited public validation, with around 99 GitHub stars and zero dependents, so it is likely maintainer-dependent and carries version-drift risk as Filament majors change. Right-click interactions also have UX and accessibility concerns, including conflicts with browser or OS context menus and limited discoverability on touch devices. Pin the package version, pilot it on a few pages, and provide keyboard-accessible alternatives for critical actions. Keep CONTEXT_MENU_ENABLED=false as a fallback until validated.