PHP code example of ericlagarda / locally

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

    

ericlagarda / locally example snippets


'web' => [
            ...
            \Smartisan\Locally\Http\Middlewares\LocallyMiddleware::class
        ],

php artisan vendor:publish --provider="Smartisan\Locally\LocallyServiceProvider" --tag="migrations"

php artisan migrate

'aliases' => [
  ...
  'Locally'   => \Smartisan\Locally\Facades\Locally::class
];

$user->setLocale('en');

$user->getLocale(); //en

Locally::getLanguageCodeByName('english'); //en
Locally::getLanguageNameByCode('en'); //English