digital-creative/column-toggler
Column Toggler is a Filament plugin for Laravel that adds a simple control for showing or hiding table columns. Users can tailor resource tables and admin lists to their needs without extra code, making dense data easier to scan and improving everyday workflows.
composer.json yourself rather than trusting marketplace metadata.*:composer require dcasia/column-toggler:^0.3.0
# Nova 4:
# composer require dcasia/column-toggler:^0.2.0
app/Providers/NovaServiceProvider.php:use DigitalCreative\ColumnToggler\ColumnToggler;
public function tools()
{
return [
new ColumnToggler(),
];
}
php artisan nova:publish if Nova’s asset pipeline requires it. Keep the published config in version control if you customize labels/icons/defaults.NovaServiceProvider::tools(), the package composer.json for Nova constraints, config/column-toggler.php if published, browser devtools localStorage, and the Nova index header DOM.public function tools()
{
$tools = [];
if (request()->user()?->isAdmin()) {
$tools[] = new ColumnToggler();
}
return $tools;
}
If the tool exposes canSee(), use that instead of branching in tools().
canSee() / hideFromIndex() and policy checks.hideFromIndex() or canSee() per role. Do not stretch this package into per-role default column sets — it persists in browser localStorage, not server-side.0.x semver line means a minor bump can carry compatibility breaks.localStorage keys for the resource, confirm the column name has not changed, then verify tool registration and package/Nova version alignment.0.x semver risk: pin the version. A minor release can carry a breaking change. Prefer ^0.3.0 with deliberate review, or an exact pin if you want maximum stability.localStorage is not server-side persistence: preferences are per browser and per resource. They do not follow users across devices, incognito sessions, or cleared site data. Tell users this up front to avoid a follow-on “my columns reset” request cycle.How can I help you explore Laravel packages today?