Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Benefit Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. composer require jeffersongoncalves/filament-benefit
  2. Publish and run the migrations: php artisan vendor:publish --tag="filament-benefit-migrations" then php artisan migrate.
  3. Optionally publish config/assets: php artisan vendor:publish --tag="filament-benefit-config" (and --tag="filament-benefit-translations" if you want to override copy in-tree).
  4. Register the plugin on your panel in 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).
  5. 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.

Implementation Patterns

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".

Gotchas and Tips

  • Publish tags are not standardised across packages. Confirm the tag names from 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.
  • Migrations run against your default connection. Read the published migration before running on a production DB with an existing benefits table — name collisions are the most common first-install failure.
  • Translations ship only for UI strings inside the package. Your own form field labels, custom actions and policy messages still need your app's lang/ files. The 17 locales do not translate your content, only the plugin's.
  • Locale files are a cache target. After editing overrides: php artisan optimize:clear. In production with config:cache/view:cache the old locale strings persist otherwise.
  • RTL is a theme concern, not a plugin concern. If ar/fa render left-aligned, the fix is in your panel's layout/->direction() handling, not in the package's lang files.
  • Version pinning matters. This is a 1.x plugin maintained alongside a family of sibling Filament plugins (scanner-guard, etc.). Pin ^1.1 and read the changelog on each minor — schema changes to a resource plugin land as minors more often than you'd like.
  • Debugging missing navigation: check the plugin is actually registered on the current panel id, that the user passes the policy, and that filament:optimize-clear has been run. Those three account for nearly every "resource doesn't show up" report.
  • Extension point of last resort: the plugin class's 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.
  • Contribution cadence signal: 1.1.0 is i18n plus CI/dependency housekeeping — a healthy maintenance release with no breaking changes. Safe to upgrade from 1.0.0 without a code review beyond confirming your translation overrides still resolve (they will, since the keys are additive).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource