PHPackages                             divineomega/laravel-domain-to-locale - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. divineomega/laravel-domain-to-locale

Abandoned → [jord-jd/laravel-domain-to-locale](/?search=jord-jd%2Flaravel-domain-to-locale)Library[Localization &amp; i18n](/categories/localization)

divineomega/laravel-domain-to-locale
====================================

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

v3.0.0(2mo ago)32451LGPL-3.0-onlyPHPPHP &gt;=7.1

Since May 22Pushed 2mo agoCompare

[ Source](https://github.com/Jord-JD/laravel-domain-to-locale)[ Packagist](https://packagist.org/packages/divineomega/laravel-domain-to-locale)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-laravel-domain-to-locale/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

Laravel Domain To Locale
========================

[](#laravel-domain-to-locale)

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

Installation
------------

[](#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
-----

[](#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
-------------

[](#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.

```
