承接 arispati/app-locale 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-06