phpinnacle/babylon

Locale selection and session-based localization for Laravel Filament panels.

Maintainers

Package info

github.com/phpinnacle/babylon

pkg:composer/phpinnacle/babylon

Transparency log

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-09-01 10:40 UTC

This package is auto-updated.

Last update: 2026-09-01 15:41:14 UTC


README

Latest Version on Packagist Total Downloads

Babylon adds locale selection to a Filament panel. It keeps the selected locale in the session, applies it through panel middleware, and provides a ready-to-use language selector for the Filament profile form.

Features

  • Panel-scoped locale middleware.
  • Configurable list of available locales.
  • Locale selector for the user profile schema.
  • Locale names supplied by phpinnacle/common.
  • No database tables or published assets.

Requirements

  • PHP 8.4 or later
  • Laravel 13
  • Filament 5
  • phpinnacle/common

Installation

composer require phpinnacle/babylon

Registering the plugin

Register BabylonPlugin in the panel and pass the locales that users may select:

use Filament\Panel;
use PHPinnacle\Babylon\BabylonPlugin;

public function panel(Panel $panel): Panel
{
    return $panel->plugin(
        BabylonPlugin::make()->locales('en', 'pl', 'ru'),
    );
}

The plugin registers SetLocale as persistent panel middleware. The selected value is read from the session key locale; when it is absent, Laravel's configured application locale remains in effect.

Adding the profile selector

Use the packaged section when composing a custom profile form:

use PHPinnacle\Babylon\BabylonPlugin;

return [
    BabylonPlugin::profile(),
];

The selector only contains locales passed to locales(). Locale codes should be valid entries supported by PHPinnacle\Intl\Locales.

Testing

composer test

Changelog

See CHANGELOG for recent changes.

License

The MIT License (MIT). See License File.