jeffersongoncalves/filament-benefit
A Laravel package that adds benefit management to Filament. It provides admin resources and tools for creating, organizing, and maintaining benefit records, helping you manage benefits directly from your Filament panel.
filament-benefit is a Filament plugin (v1.1.0, targeting Filament v3/v4-era panels) that ships a benefit resource — models, migrations, resources and translations — so you can drop a working benefits module into a panel instead of hand-rolling one.
Minimal steps:
composer require jeffersongoncalves/filament-benefitphp artisan vendor:publish --tag="filament-benefit-migrations" then php artisan migrate.php artisan vendor:publish --tag="filament-benefit-config" (and --tag="filament-benefit-translations" if you want to override copy in-tree).app/Providers/Filament/AdminPanelProvider.php inside ->plugins([ ... ]), using the plugin class from the package's src/ root (check the README for the exact FQCN — it follows the Vendor\Package\...Plugin convention).php artisan filament:optimize-clear (or just hard-refresh) and open the panel; the benefit resource should appear in navigation.Where to look first:
src/ — the plugin class (navigation group, label, icon, resource registration) is the single place to change how it appears in the panel.resources/lang/ — 17 locales now ship here (ar, az, de, es, fa, fr, hi, it, ja, nl, pl, pt, ru, tr, uk, uz, zh_CN); copy en to lang/vendor/filament-benefit/<locale>/ to override.database/migrations/ — the schema is the real contract; read it before writing any custom relation or export.First use case: register the plugin on an internal admin panel, seed a handful of benefit records, and let HR create/edit them through the generated resource. That is the 20-minute win; everything else is customisation.
Panel-scoped registration. Prefer registering the plugin on a single panel (e.g. AdminPanelProvider) rather than the default panel, and use the plugin's fluent methods — usually ->navigationGroup(), ->navigationLabel(), ->navigationIcon(), ->slug() — from inside ->plugins([...]) so customisation survives package upgrades.
Translation overrides instead of forks. With 1.1.0 shipping 17 locales, the correct pattern for copy changes is a lang/vendor/filament-benefit/{locale}/*.php override file loaded by Laravel's vendor namespace resolution. Never edit resources/lang/ inside vendor/; Composer will wipe it. Publish only the locales you actually rewrite.
Locale switching. The new locales make this plugin usable in multi-language panels. Set app()->setLocale() from a middleware or Filament's user-locale field and the resource labels follow automatically — no per-locale resource duplication needed. Verify RTL rendering (ar, fa, uz) in the panel layout, since Filament handles dir="rtl" at the layout level, not the plugin.
Policy and tenancy integration. The package resource respects Filament's normal authorization path. Create a BenefitPolicy and register it in AuthServiceProvider; the resource picks it up via canViewAny/canCreate on the model. If you're on a multi-tenant panel, implement Filament\Models\Contracts\HasTenants on the benefit model (or a tenant() scope) rather than adding a global scope in a service provider — Filament's tenant scoping expects the relationship.
Extending the resource. Two supported routes: (a) subclass the package resource and set protected static ?string $model / override form()/table(), then un-register the original via ->resources([]) in the plugin config; or (b) keep the package resource as-is and attach your own relation manager or table action through the plugin's extension hooks. Route (a) is more common and more brittle across majors — pin the version if you go there.
Data import/export. Because migrations own the schema, write imports against the Eloquent model (Benefit::create([...])) with updateOrCreate keyed on whatever unique column the migration defines, so re-running a seeder is idempotent. For exports, Filament\Tables\Actions\ExportAction or a queued job against the model is safer than scraping the table.
Testing. Filament resource tests work well with livewire(SomeResource\Pages\ListBenefits::class)->assertCanSeeTableRecords($benefits). Authenticate a user with the policy granted in setUp(); without a policy the resource stays hidden and tests fail with a misleading "record not found".
composer.json's extra.laravel block or the README before running vendor:publish; a wrong tag fails silently and you'll wonder why no migrations appeared.benefits table — name collisions are the most common first-install failure.lang/ files. The 17 locales do not translate your content, only the plugin's.php artisan optimize:clear. In production with config:cache/view:cache the old locale strings persist otherwise.ar/fa render left-aligned, the fix is in your panel's layout/->direction() handling, not in the package's lang files.^1.1 and read the changelog on each minor — schema changes to a resource plugin land as minors more often than you'd like.filament:optimize-clear has been run. Those three account for nearly every "resource doesn't show up" report.register()/boot() methods and the package service provider are where to hook in if you need behaviour that isn't exposed fluently — but subclass the provider rather than editing vendor code.How can I help you explore Laravel packages today?