- What does asignua/filament-toggle-icon-column actually do?
- It adds a table column to Filament 5 resources and relation managers that renders a boolean model attribute as a clickable on/off icon. Clicking the icon flips the value in place from the table row, so users avoid opening an edit form just to change a flag. It is a replacement for the older archilex/filament-toggle-icon-column package and keeps a similar API, including onColor(), offColor() and hoverColor() methods that mirror Filament's built-in IconColumn colour API.
- How do I install filament-toggle-icon-column in a Laravel app?
- Install it with composer require asignua/filament-toggle-icon-column, which registers through Laravel package auto-discovery so no manual service provider wiring is normally needed. After that, publish any optional config if you want to change defaults and run php artisan filament:assets so the package stylesheet is exposed to the panel. Finally, add the column to your Filament resource or relation manager table and point it at your boolean attribute.
- Which Filament and Laravel versions are supported?
- The package is published for Filament 5 tables and relation managers, which is the version stated in its overview. Laravel and PHP constraints are declared in the package's composer.json, so check that file against your project's locked versions before committing. If you are still on Filament v3 or v4, verify support with the maintainer or run a short spike, because Filament's CSS token names differ between majors and the plugin paints colours via those tokens.
- Do I need to run php artisan filament:assets on every deploy?
- Very likely yes. The colour fix that makes onColor(), offColor() and hoverColor() visible ships as a stylesheet, and the notes imply it goes through Filament's asset pipeline. That means a deploy that skips filament:assets can leave stale or missing CSS, and the symptom is grey or unstyled icons rather than an error. Add the command to your deploy runbook and CI pipeline so the failure mode is caught before production.
- How do I customise the on, off and hover colours of the toggle icon?
- Use the fluent onColor(), offColor() and hoverColor() methods on the column, the same pattern as Filament's IconColumn. The hover colour drives a preview state so users can see what the icon will become before they click. The plugin relies on Filament's CSS custom properties, such as the text tokens used in light and dark mode, to paint these colours, so custom colours outside Filament's palette should be checked in both themes.
- Does the toggle respect Laravel policies and Filament authorization?
- Filament columns inherit the panel's authorization behaviour, and this plugin is designed to delegate the write back to Filament and Livewire rather than mutating the model outside the policy layer. You should still confirm it explicitly on a staging model: test with a user who is denied update permission and verify the toggle is either hidden or rejected server-side. A column that flips state without consulting policies would be a hard blocker for production use, so treat this as a must-verify item in your spike.
- Can I use it in Filament relation managers, not just resource tables?
- Yes. The package is explicitly described as working for Filament 5 tables and relation managers, so you can drop it into the table schema of a RelationManager and toggle related records inline. This is handy for pivot-style or child records where an is_active or is_visible flag changes often. Keep in mind relation manager tables sometimes use a narrower layout, so check that the icon column still fits alongside your other columns.
- How does this compare with archilex/filament-toggle-icon-column?
- This package is the successor to archilex/filament-toggle-icon-column and is aimed at Filament 5, while the original was built for earlier Filament majors. The API stays familiar, with on and off colour methods plus hover preview, tooltips and authorization support. If you are migrating, the main differences to plan for are the Filament 5 version bump and the stylesheet step needed for colours to render.
- Does the icon update without a full page reload?
- Yes, in principle. The toggle is a Livewire-driven interaction, so clicking the icon should persist the new value and re-render just that row, updating the icon and colour without a page refresh. Whether the colour swaps instantly in every theme depends on the stylesheet being published and the Filament text tokens being present. Test both light and dark mode in your spike, since the plugin explicitly compensates for a styling path Filament core does not expose.
- Is this package safe to depend on in production?
- It is a small, additive UI component with no schema changes, so runtime risk is low, but maturity is the main concern. The package is at a v1.0.x line with a follow-up patch that fixed colours, which suggests a single maintainer and a thin automated test surface, especially for rendered output. Before adopting it, pin the version, add filament:assets to your deploy pipeline, verify policy enforcement, and be aware that future Filament minor releases could rename the CSS tokens the plugin depends on and silently regress colours to grey.