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

Laravel Language Laravel Package

jobmetric/laravel-language

jobmetric/laravel-language is a Laravel package for managing application languages and localization. It offers language CRUD, activation and default-language handling, plus helpers for multilingual Eloquent models, locale switching, and translation storage in Laravel apps.

View on GitHub
Deep Wiki
Context7

It is a standard package for managing different system languages in Laravel.

Frequently asked questions about Laravel Language
How do I install jobmetric/laravel-language in a Laravel application?
Install it with composer require jobmetric/laravel-language. Laravel package discovery should register the service provider and facade automatically; if you have discovery disabled you will need to register them manually. Publish the config and migration files, run your migrations, and register SetLanguageMiddleware (and SetTimezoneMiddleware if you need per-request timezone handling) in your HTTP kernel. Review the published language table migration before running it against a production database, since it includes a calendar column.
What PHP and Laravel versions does jobmetric/laravel-language require?
The package requires PHP 8.2 or newer, so older applications will need an upgrade first. Its Laravel query builder dependency moved from 5.7 to 6.3, a major-version jump that likely constrains the supported Laravel range to something in the Laravel 10/11 era. The official Laravel support matrix is not clearly documented in the changelog, so verify your framework version against the composer constraints before committing to an integration.
How do I switch the application locale per request with this package?
The package ships SetLanguageMiddleware, which resolves the language for each request and applies it to the application. It also dispatches a SetLocaleEvent, so you can hook your own listeners into the locale change. Register the middleware in your HTTP kernel and make sure your language table has an active default row. If you need a locale switch independent of middleware, the Language service class is the entry point.
How does jobmetric/laravel-language store translations for multilingual Eloquent models?
The package provides helpers for multilingual Eloquent models plus translation storage backed by its language table, so you can associate translated values with a language record. It also includes a DateBasedOnCalendarCast so date attributes can be presented according to the selected calendar. The exact storage strategy depends on your model setup, so check the published config and migration before designing your schema. Keep in mind that some date-conversion logic has moved out to panelify/multi-calendar.
Is it safe to upgrade jobmetric/laravel-language to 2.1.1?
Treat 2.1.1 as a breaking release despite its patch version. It renames public symbols (LangaugeAddEvent to LanguageStoredEvent, addLanguageDate to addLanguageData), changes namespaces for SetLocaleEvent and exception classes, removes DateConverter, changes the facade resolution path, and raises the required PHP version. Pin an exact version rather than a caret range, and grep your codebase for the old symbols before upgrading. Run a boot smoke test plus your existing suite, because the changelog is hand-assembled and may omit changes.
What are the alternatives to jobmetric/laravel-language?
For model-level translation storage, spatie/laravel-translatable and astrotomic/laravel-translatable are the widely adopted options. For URL and route localization, mcamara/laravel-localization is the common choice. jobmetric/laravel-language sits a bit differently: it combines language CRUD, activation and default-language management, middleware-driven locale resolution, validation rules, and Eloquent helpers in one package. The trade-off is a younger package with sibling dependencies under active decomposition.
Does jobmetric/laravel-language require the PHP intl extension?
There is an implied runtime dependency on ext-intl driven by the date-conversion work, but the changelog does not state whether that requirement applies to the cast, the middleware, or only the removed DateConverter. The safe approach is to install and enable ext-intl on your PHP 8.2 runtime regardless. If you cannot enable intl, test the specific features you plan to use before adopting the package.
How do I set a default language and activate or deactivate languages?
Default-language and activation handling are part of the package's core Language service and Eloquent model, alongside the standard CRUD operations. The middleware resolves the request locale from those records, so only active languages should be selectable at runtime. If you are adding the calendar column to an existing install, plan a data backfill for current language rows. Confirm your default row exists before enabling the middleware in production.
What are panelify/core and panelify/multi-calendar, and do I need them?
They are sibling packages that this release depends on transitively. Validation-error handling moved into panelify/core (1.26) and the DateConverter moved into panelify/multi-calendar (1.2). They are pulled in automatically by Composer, but their public release status, documentation, and support model are not documented here. Before adopting, confirm who owns and supports these packages and whether they carry an upgrade contract you can rely on.
Is jobmetric/laravel-language well tested and actively maintained?
Test coverage is a genuine strength: new tests accompany the middleware, custom cast, validation rules, and service work, which lowers the risk of silent behavioral regressions. Release hygiene is the weaker area, since a patch version shipped multiple breaking changes and the changelog contains duplicated entries and typos. Pin exact versions, review each release diff manually, and avoid assuming the absence of a changelog line means nothing changed. If your team needs a stable, documented upgrade path, factor that maintenance risk into the decision.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console