outl1ne/nova-locale-manager
A Laravel Nova tool and resource for managing your application's locales and languages from the admin panel. Add, edit, enable or disable locales and set the default language without touching configuration files, keeping multilingual projects simple to maintain.
composer require outl1ne/nova-locale-manager. This is a Nova tool, so it assumes laravel/nova is already installed and working.locales migration is auto-loaded or needs php artisan vendor:publish --tag=... first. Run php artisan migrate and confirm the locales table exists.app/Nova/NovaServiceProvider.php inside tools():
public function tools()
{
return [
new \Outl1ne\NovaLocaleManager\NovaLocaleManager(),
];
}
vendor/outl1ne/nova-locale-manager/src/ — the tool class, the Locale model, and the Nova resource are the whole package; read them before assuming behavior.vendor/outl1ne/nova-locale-manager/database/migrations/ — the actual schema (column names matter for everything downstream).vendor/outl1ne/nova-locale-manager/config/ — if a config is published, it usually holds table name and model binding.en, de, fr) with a default flag, then in your app read them from the package's model for a language switcher, hreflang tags, or as options in a Nova Select on other resources.Locale::create([...])) so every environment matches, and use the Nova UI only for ad-hoc edits.Locale::where('code', $code)->exists()), and fall back to the default row. Store the default in a cached lookup rather than querying every request.spatie/laravel-translatable or outl1ne/nova-translatable, the locale code column is your bridge — keep them in sync so form tabs / translated fields match the rows here.Select::make('Locale')->options(
Locale::pluck('name', 'code')
)
<link rel="alternate" hreflang="..."> per route is the cleanest integration.Cache::rememberForever('locales', fn () => Locale::all()) and Cache::forget('locales') from a model observer on save/delete.Nova::script mismatch is the usual culprit. Forking a package this small is often faster than waiting for a fix.code, name, is_default, enabled — verify in the file) are not stable across forks. Read the migration; don't guess ->where('default', true).saving hook, and decide explicitly what happens when the default locale is deleted or disabled.enabled/active flag over hard deletes, or block deletion of locales present in translated tables.vendor:publish for both config and migrations. If the tool appears in the sidebar but the table is missing, this is the first thing to check.App\Models\Locale extending the package model), a model observer for cache invalidation, and the Nova resource for adding fields (e.g. flag icon, RTL boolean) rather than editing vendor files.php artisan nova:check won't know about this tool; instead dump Nova::availableTools(request()) or check the compiled nova-components manifest if the sidebar entry 404s.locales table plus one Nova resource, this package saves maybe 40 lines — weigh that against an unmaintained dependency. The migration + resource are trivial to hand-roll if compatibility becomes a problem.How can I help you explore Laravel packages today?