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

Config Laravel Package

laravel-lang/config

Official configuration package for Laravel Lang, providing shared settings and defaults used across its localization tools so you can manage language files and locales consistently in Laravel apps.

View on GitHub
Deep Wiki
Context7

Config repository for Laravel-Lang packages

Frequently asked questions about Config
What is laravel-lang/config used for?
It is the official configuration package for Laravel Lang, providing shared settings and defaults for its localization tools. It helps you manage language files and locales consistently across Laravel applications. It fits Laravel's config helper and service container patterns rather than replacing them.
How do I install laravel-lang/config in a Laravel app?
Install it with Composer using composer require laravel-lang/config. Register the LaravelLangConfigServiceProvider if your application does not auto-discover it. Then publish the package configuration with vendor:publish and clear cached config after changes. Exact publish tags may depend on your Laravel-Lang package versions.
Which Laravel versions are supported by laravel-lang/config?
The package is designed for Laravel 8 and newer, with explicit support noted for Laravel 11 through 13. Version alignment matters because v2.x drops support for Laravel below 8 and v1.x drops support for Laravel below 10. Check the package release you install against your application's Laravel version before upgrading.
How do I publish Laravel Lang configuration files?
Use Laravel's vendor:publish command after installing the package. The package publishes configs under config/locales by default, which may conflict with existing directory structures. You can customize publish paths through the service provider if you need a different layout. Clear config cache after publishing or changing files.
How do locale fallbacks work with laravel-lang/config?
It supports hierarchical fallback chains such as es_MX to es to en, which reduces duplicated translations. The package relies on Laravel's current locale or your own locale-resolution logic. You should explicitly handle edge cases like right-to-left languages and priority order in your application.
Do I need to clear config cache after changing Laravel Lang settings?
Yes, file-based configuration changes require clearing Laravel's config cache, typically with config:clear. This can add deployment friction if settings change often. Automate cache clearing in CI/CD scripts or deployment hooks to keep locale behavior consistent.
Can laravel-lang/config handle per-user or real-time locale settings?
It is not intended for dynamic, per-user configuration overrides because it uses Laravel's file-based config and config caching. Real-time constraints are better handled with Redis, a database-backed config layer, or a hybrid approach. Use files for static locale defaults and another store for user-specific preferences.
How does laravel-lang/config integrate with other Laravel Lang packages?
It provides shared configuration and defaults used by Laravel Lang localization tools, so packages such as laravel-lang/translator can work from consistent settings. It also fits Laravel-native patterns like config(), service providers, and Artisan commands. Spatie laravel-data is used internally for DTOs, but that does not require direct work from most users.
How should I test locale-specific configuration in a Laravel app?
Set the application locale in your Laravel tests and assert that configuration and fallback chains resolve as expected. Pay special attention to complex chains like es_MX to es to en, since those deserve dedicated test cases. The package supports mocking, but locale behavior should still be covered by your own integration tests.
What are alternatives to laravel-lang/config for dynamic localization settings?
For dynamic values, evaluate database-driven configuration packages such as Spatie's laravel-config-array or external feature-flag services like LaunchDarkly. For mostly static locale files, Laravel's native config plus laravel-lang/config is usually simpler. A hybrid approach can keep static language files in config while storing user-specific locale preferences elsewhere.
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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log