| Package Data | |
|---|---|
| Maintainer Username: | arispati |
| Maintainer Contact: | masarispati@gmail.com (Aris) |
| Package Create Date: | 2021-08-06 |
| Package Last Update: | 2021-08-06 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-04 15:07:46 |
| Package Statistics | |
|---|---|
| Total Downloads: | 21,616 |
| Monthly Downloads: | 294 |
| Daily Downloads: | 2 |
| Total Stars: | 1 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
Localization for Laravel and Lumen Framework
This package will set the locale of the application by the request that contains the App-Locale attribute in the header
composer require arispati/app-locale
// app/Http/Kernel.php
protected $middleware = [
// ...
\Arispati\AppLocale\Middleware\AppLocale::class
];
// bootstrap/app.php
$app->middleware([
\Arispati\AppLocale\Middleware\AppLocale::class
]);
Facade
// bootstrap/app.php
// Enabled Facade
$app->withFacades(true, [
'\Arispati\AppLocale\Facades\AppLocale' => 'AppLocale'
]);
// Register service provider
$app->register(\Arispati\AppLocale\ServiceProvider::class);
AppLocale::setLocale('id'); // set app locale to 'id' (Bahasa Indonesia)
AppLocale::getLocale();