PHP code example of vrnvgasu / localization

1. Go to this page and download the library: Download vrnvgasu/localization 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/ */

    

vrnvgasu / localization example snippets


namespace App\Http\Middleware;

use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
use Vrnvgasu\Localization\Services\Locale\Locale;

class EncryptCookies extends Middleware
{
    protected $except = [
        Locale::USER_LOCALE,
    ];
}

use Illuminate\Support\Facades\Route;
use Vrnvgasu\Localization\Middleware\Localization;

Route::group(array(
    'middleware' => Localization::ALIAS,
), function() {
    //
});

    'locales' => [
        'en' => [
            'lang' => 'lang',
            'name' => 'en',
        ],
        'ru' => [
            'lang' => 'яз',
            'name' => 'рус',
        ],
        'new_locale' => [
            'lang' => 'drop_down_button_name',
            'name' => 'language_name',
        ],
    ],

'default' => 'new_locale',

'users_table' => 'users_table_name',

php artisan migrate

php artisan vendor:publish --tag=vrnvgasu_localization__config

php artisan vendor:publish --tag=vrnvgasu_localization__view