PHP code example of divineomega / laravel-domain-to-locale

1. Go to this page and download the library: Download divineomega/laravel-domain-to-locale library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

divineomega / laravel-domain-to-locale example snippets


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



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',

    ]

];
bash
php artisan vendor:publish --provider="DivineOmega\LaravelDomainToLocale\ServiceProvider"