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

Nova Locale Manager Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install into an existing Nova app: composer require outl1ne/nova-locale-manager. This is a Nova tool, so it assumes laravel/nova is already installed and working.
  2. Publish and migrate. Check the package README / service provider for whether the locales migration is auto-loaded or needs php artisan vendor:publish --tag=... first. Run php artisan migrate and confirm the locales table exists.
  3. Register the tool in app/Nova/NovaServiceProvider.php inside tools():
    public function tools()
    {
        return [
            new \Outl1ne\NovaLocaleManager\NovaLocaleManager(),
        ];
    }
    
  4. Where to look first, in order:
    • 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.
  5. First use case: open the tool from the Nova sidebar, add your site's locales (e.g. 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.

Implementation Patterns

  • Treat it as seeded reference data, not user content. Locale rows are effectively configuration. Seed them in a seeder or migration (Locale::create([...])) so every environment matches, and use the Nova UI only for ad-hoc edits.
  • Language switcher middleware. Resolve the active locale from session/URL, validate it against the table (Locale::where('code', $code)->exists()), and fall back to the default row. Store the default in a cached lookup rather than querying every request.
  • Wiring into translation workflows. If you use 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.
  • Options in other Nova resources. Use the model to populate selects dynamically so adding a locale in the tool immediately makes it selectable elsewhere:
    Select::make('Locale')->options(
        Locale::pluck('name', 'code')
    )
    
  • Hreflang / sitemap generation. A scheduled command or view composer that reads all active locales and emits <link rel="alternate" hreflang="..."> per route is the cleanest integration.
  • Caching layer. Because the table is tiny and read on nearly every request, wrap it: Cache::rememberForever('locales', fn () => Locale::all()) and Cache::forget('locales') from a model observer on save/delete.
  • Don't couple domain logic to the Nova tool. Reference the underlying model (or a small repository around it), not the tool class, so your translation layer survives if you swap the admin UI.

Gotchas and Tips

  • Age and Nova compatibility. Last release was July 2022, so it targets the Nova 3/4 era. Verify it boots on your Nova major version before committing; if the tool class fails to register, a one-line namespace or Nova::script mismatch is the usual culprit. Forking a package this small is often faster than waiting for a fix.
  • Migration is the source of truth. Column names (code, name, is_default, enabled — verify in the file) are not stable across forks. Read the migration; don't guess ->where('default', true).
  • Default-locale uniqueness is not enforced by the DB. Nothing stops two rows being flagged default. Guard it in a model observer or a saving hook, and decide explicitly what happens when the default locale is deleted or disabled.
  • Deletion vs. disable. If you have translated content keyed by locale code, deleting a row orphans it. Prefer an enabled/active flag over hard deletes, or block deletion of locales present in translated tables.
  • Publishing tags. Nova tool packages frequently require an explicit 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.
  • Extension points to reach for: the config's model binding (repoint to your own 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.
  • Debugging registration issues: 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.
  • Exit criteria. If all you need is a 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.
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