Download the PHP package naoray/laravel-localizer without Composer
On this page you can find all versions of the php package naoray/laravel-localizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-localizer
laravel-localizer
Easily detect the language of your user from session
, cookie
, browser locale
or app setting
. Change locale with a get request to localizer::setLocale
and control which language version the user can see via localizer
middleware.
This package is using codezero/laravel-localizer behind the scenes and extends its functionality to include:
- add Route
localizer::setLocale
for changing locales - add Carbon store to get localized timestamps
- add Facade to use
allowedLocales()
method in views
Install
composer require naoray/laravel-localizer
Publish config with php artisan vendor:publish --provider="CodeZero\Localizer\LocalizerServiceProvider" --tag="config"
Usage
Add Supported Locales
Edit supported-locales
array of the localizer
config to include all allowed locales.
Add Carbon Store
Add \Naoray\LaravelLocalizer\Stores\CarbonStore::class
to localizerstores
to enable the carbon store and sync current locale with carbon locale.
Use Localizer in middleware
Add localize
middleware to your web route in the RouteServiceProvider
Or simply add it as a middleware to your route groups.
Add Change Locale routes in view
Add Localizer
Facade to app
config.
In the view you can use allowedLocales()
to get all allowed locales in the view.
Extend Functionalities
You can add new stores
and detectors
by implementing the corresponding interface. For more info visit codezero/laravel-localizer
Testing
Run the tests with:
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security-related issues, please email DummyAuthorEmail instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-localizer with dependencies
illuminate/routing Version ^6.0|^7.0|^8.0
codezero/laravel-localizer Version ^1.4