承接 shaunthegeek/laravel-locale-setter 相关项目开发

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

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

shaunthegeek/laravel-locale-setter

最新稳定版本:v2.0.0

Composer 安装命令:

composer require shaunthegeek/laravel-locale-setter

包简介

detect Accept-Language, setLocale for Laravel

README 文档

README

Automatically scanning the lang directory for locales, detecting the HTTP Accept-Language header, and setting the Laravel locale — all are handled seamlessly by this package.

Installation

composer require shaunthegeek/laravel-locale-setter

Add Middleware

// bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
    $middleware->web(remove: [
        \Illuminate\Routing\Middleware\SubstituteBindings::class,
    ]);
    $middleware->web(append: [
        ShaunTheGeek\LaravelLocaleSetter\Middleware\DetectLocale::class,
        \Illuminate\Routing\Middleware\SubstituteBindings::class,
    ]);
})

Optional

If you wish to modify the configuration, please publish it first.

php artisan vendor:publish --tag=locale-config

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固