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 Language Tab Laravel Package

ildaviz/filament-language-tab

Filament Language Tab adds locale tabs to Filament forms so you can edit multilingual content in one place. Switch between languages, manage translated fields per locale, and keep translations organized without separate forms. A lightweight package for building multilingual admin panels with Filamen...

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install the package:
    composer require <vendor>/<package>
    
  2. Publish any config/assets if the package exposes them:
    php artisan vendor:publish --tag=<package-config>
    
  3. For Filament integrations, register the plugin on your panel provider:
    public function panel(Panel $panel): Panel
    {
        return $panel->plugin(\Vendor\Package\PackagePlugin::make());
    }
    
  4. Look first at:
    • README.md for the supported Filament/Laravel version matrix.
    • The facade class for the day-to-day API surface (the 1.0.0 notes explicitly fixed facade comments, so this is the intended entry point).
    • Any config file after publishing; check defaults for preview behaviour and label rendering.
  5. First use case: wire the package into a Filament resource form/table and use the custom label closure to render dynamic labels, then verify the beforeSave hook fires as expected on create and update.

Implementation Patterns

  • Facade-first calls: Use the package facade for one-off operations (e.g. enabling preview, configuring label resolution) and the Filament plugin for panel-wide defaults. Keep facade usage in service/action classes rather than directly in resource classes where possible.
  • beforeSave hook: Register a callback to mutate or validate model data immediately before persistence. Keep callbacks small and delegate to actions:
    Package::beforeSave(function (Model $record, array $data) {
        $data['slug'] = Str::slug($data['title']);
        return $data;
    });
    
    Test both create and update paths — 1.0.0 includes a specific fix for beforeSave logic, so add regression coverage in your own app if you depend on it.
  • Preview workflow: Use the new preview feature to render the Filament form/table output without persisting. This is useful for label/closure iteration and for staging form changes. Pair preview with a feature flag so it is not accidentally exposed in production.
  • Custom label closures: Prefer the closure-based label API over hard-coded strings when labels depend on record state, translations, or tenant context. Keep closures pure and side-effect free; they may be evaluated multiple times during rendering.
  • Integration tip: Wrap package-specific calls behind a small app-level service or Filament trait so upgrades do not leak into every resource.

Gotchas and Tips

  • Preview must not persist: Confirm that code paths exercised in preview do not call save() or dispatch model events that assume persistence. Guard beforeSave side effects if preview reuses the same form pipeline.
  • beforeSave ordering: The 1.0.0 fix indicates this logic was corrected; verify hook order relative to Filament’s own lifecycle callbacks and Laravel model events. If multiple callbacks are registered, confirm the execution order you expect.
  • Closure binding: Facade comments were fixed in this release; if you previously relied on undocumented behaviour around facade resolution or closure binding, re-test after upgrading.
  • Config caching: After publishing config, run php artisan config:cache in deployment. Changes to label closures registered in providers will not be reflected until caches are cleared.
  • Extension points: Prefer the documented closure hooks (beforeSave, label closures) over subclassing package internals. 1.0.0 is the initial base release, so internal APIs may still shift; closures and the facade are the safer seams.
  • Debugging: Start with the facade’s resolved instance and the published config. If labels or preview behave unexpectedly, isolate the closure in a unit test before debugging through Filament’s render stack.
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.
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk