arispati/app-locale
最新稳定版本:v0.1.0
Composer 安装命令:
composer require arispati/app-locale
包简介
Localization for Laravel and Lumen Framework
README 文档
README
Localization for Laravel and Lumen Framework
Description
This package will set the locale of the application by the request that contains the App-Locale attribute in the header
How to Install
- Install with composer
composer require arispati/app-locale
Laravel
- Register the middleware
// app/Http/Kernel.php protected $middleware = [ // ... \Arispati\AppLocale\Middleware\AppLocale::class ];
Lumen
- Register the middleware
// bootstrap/app.php $app->middleware([ \Arispati\AppLocale\Middleware\AppLocale::class ]);
- if you want to use
Facade
// bootstrap/app.php // Enabled Facade $app->withFacades(true, [ '\Arispati\AppLocale\Facades\AppLocale' => 'AppLocale' ]); // Register service provider $app->register(\Arispati\AppLocale\ServiceProvider::class);
Available Method
- Set app locale
AppLocale::setLocale('id'); // set app locale to 'id' (Bahasa Indonesia)
- Get app locale
AppLocale::getLocale();
统计信息
- 总下载量: 22.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-08-06