承接 calamandrei-lorenzo/laravel-browser-lang 相关项目开发

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

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

calamandrei-lorenzo/laravel-browser-lang

Composer 安装命令:

composer require calamandrei-lorenzo/laravel-browser-lang

包简介

Auto detect browser language with middleware.

README 文档

README

Auto detect browser default language

Build Status Latest Stable Version Latest Unstable Version Scrutinizer Code Quality Code Coverage Total Downloads License

This package make available a middleware that auto-detect the language accepted from the browser and set it as current locale.

Requirement

  1. PHP >= 7.4
  2. laravel/framework >= 5.8|6.0|7.0

Tested on laravel/framework >= 7.0

Installing

$ composer require calamandrei-lorenzo/laravel-browser-lang

Optional, you can publish the config file:

$ php artisan vendor:publish --provider="CalamandreiLorenzo\\LaravelBrowserLang\\ServiceProvider" --tag=config

Implement the middleware in your App\Http\Kernel:

use CalamandreiLorenzo\LaravelBrowserLang\Http\Middleware\BrowserLang;

class Kernel extends HttpKernel
{
        /**
         * The application's route middleware.
         *
         * These middleware may be assigned to groups or used individually.
         *
         * @var array
         */
        protected $routeMiddleware = [
            // ...
            'detect-language' => BrowserLang::class
        ];
}

Usage

Route::middleware('detect-language')->group(static function () {
    // routes
});

Otherwise set it as a global middleware in your App\Http\Kernel file.

class Kernel extends HttpKernel
{
    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [
        // ...
        BrowserLang::class
    ];
}

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固