jord-jd/laravel-domain-to-locale 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jord-jd/laravel-domain-to-locale

最新稳定版本:v3.0.0

Composer 安装命令:

composer require jord-jd/laravel-domain-to-locale

包简介

Change your Laravel app's locale based on the domain name

README 文档

README

Change your Laravel app's locale based on the domain name.

Installation

To install the Laravel Domain To Locale package, just run the following Composer command from the root of your project.

composer require jord-jd/laravel-domain-to-locale

Setup

This package requires you to register a global middleware within your app\Http\Kernel.php file. Just add the line below to your $middleware array.

\JordJD\LaravelDomainToLocale\Http\Middleware\DomainToLocale::class,

After installation, the config file must be setup within your project. To do so, simply run the following Artisan command.

php artisan vendor:publish --provider="JordJD\LaravelDomainToLocale\ServiceProvider"

Configuration

The published configuration file for this package can be found at config/domain-to-locale.php. This file defines a map between domain name and locale, as shown in the example below.

<?php

return [

    // Define the mapping from domain name to locale

    'map' => [

        'example.com'   => 'en',
        'example.co.uk' => 'en',
        'example.pl'    => 'pl',
        'example.de'    => 'de',
        'example.fr'    => 'fr',

    ]

];

Adding new lines to the map array will allow you to specify which domain names should set which locales. Once configured, everything else is automatic.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2026-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固