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 Json Column Laravel Package

valentin-morice/filament-json-column

A Filament package for working with JSON columns: view and edit nested JSON data in your forms and tables with a clean, readable interface. Adds a dedicated JSON column and field so structured data stays easy to inspect and manage in the admin panel.

View on GitHub
Deep Wiki
Context7

Getting Started

The headline of v4.1.0 is translation support, so the first thing to do after composer update is find out what got translatable and how strings are resolved.

  1. Upgrade and inspect the diff. Run composer update <vendor>/<package> and then git diff composer.lock. A minor bump that adds i18n usually pulls in a lang/ directory and one or more publishable tags — check php artisan vendor:publish --list (or --provider="Vendor\Package\PackageServiceProvider") to see exactly which tags are new.
  2. Publish the language files. Typically php artisan vendor:publish --tag=<package>-lang (or --tag=<package>-translations). Read the published files before touching them — they are the authoritative list of keys and the fastest documentation you will get.
  3. Look at the config first. Translation work almost always introduces a config knob: fallback locale, whether to use the app locale or a package-specific one, JSON vs. PHP key style, or a driver (file / database / API). Confirm the key names rather than assuming fallback_locale matches Laravel's.
  4. Ship one visible string through it. Pick the most user-facing output the package renders — a flash message, an email subject, a validation error — and confirm it renders in en, then override it in lang/vendor/<package>/en/<file>.php with a sentinel value to prove the override wins.

First use case worth wiring end-to-end: a request-scoped locale switcher plus one overridden string. That validates publishing, override path, and cache behaviour in a single pass.

Implementation Patterns

Override, don't edit vendor files. Laravel's lang/vendor/{package}/{locale}/{file}.php convention means your customised copy lives in your repo and survives upgrades; the published file is just a starting point. Keep overrides minimal (only the keys you actually change) so new keys arrive with future releases instead of being frozen at v4.1.0 wording.

Set the locale deliberately, per surface. The common bug is locale leaking between contexts. Use a small middleware for web requests:

public function handle($request, Closure $next)
{
    app()->setLocale(
        $request->user()?->locale
        ?? $request->session()->get('locale')
        ?? $request->getPreferredLanguage(config('app.supported_locales'))
        ?? config('app.fallback_locale')
    );

    return $next($request);
}

Locale-aware queued work. Anything the package renders inside a job or notification must carry its locale with it. Prefer ->locale($user->locale) on mailables/notifications, or app()->setLocale() at the top of the job's handle() — never rely on the locale present when the job was dispatched, because the worker's default is whatever config('app.locale') says.

Respect the package's key namespace. If the release exposes __('<package>::messages.foo'), use it rather than duplicating English strings in your Blade. Mixed strategies are how you end up with half a page translated.

Parameterised and pluralised strings. Pass data explicitly, not via concatenation:

trans_choice('<package>::messages.items', $count, ['count' => $count]);

Concatenating translated fragments breaks the moment a language reorders the sentence — a real risk in the languages you're likely adding next.

Validation and API messages. If the package ships validation rules, check whether it now reads from lang/{locale}/validation.php or its own namespace. For JSON APIs, return message fields through the same translator and set Accept-Language handling in middleware so clients control it per request rather than per session.

Testing. Assert on behaviour, not on the English string:

app()->setLocale('fr');
$this->assertSame(__('<package>::messages.saved'), $response->json('message'));

This keeps tests green when copy changes and actually proves the translation path works, which a hardcoded English assertion does not.

Gotchas and Tips

  • Caches hide everything. php artisan config:cache freezes locale config, and long-running workers (Octane, Horizon) will happily serve a stale translator. After changing lang files or locale config, run php artisan optimize:clear before debugging anything else — it is the cause of a large share of "translations don't update" reports.
  • The fallback locale silently masks missing keys. A key missing in de renders in en and looks fine. In non-production, set 'fallback_locale' => null (or add a test that diffs key sets across locales) so gaps surface loudly instead of shipping as mixed-language UI.
  • Key-name drift across versions. v4.1.0 adds the namespace; later patches may rename or restructure keys. Pin the package version, and add a test that asserts every key your app references exists. That converts a silent regression into a red build.
  • Don't translate data, only chrome. User-supplied content, slugs, and external identifiers should never pass through the translator. Watch for package-generated names that look like UI (status labels, enum names) — those usually need a mapping table, not __() on the raw value.
  • Locale affects more than strings. Dates, numbers, and currency come from Carbon/Intl and follow the app locale independently of the package. If dates look wrong in a language whose strings are correct, the problem is Carbon::setLocale()/app()->setLocale(), not the new translation files.
  • Layout, not just language. If the target locales include RTL, check the package's markup for hardcoded left/right classes and physical padding. Translation support in the PHP layer frequently arrives before the CSS catches up.
  • Extension point to reach for first: the translator/loader binding. If your strings live in a database or a translation SaaS, rebind the loader rather than patching the package. Verify the container binding name in the service provider — guessing here costs more time than reading the provider.
  • Upgrade note: v4.1.0 is additive, so no migration is expected, but it does touch output paths. Re-run your locale-related feature tests and one end-to-end check of any cached or queued output before deploying; that is where an additive i18n release most often shows up as a regression.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core