PHP code example of luizjr / language

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

    

luizjr / language example snippets


LuizJr\Language\Provider::class,

'Language'   => LuizJr\Language\Facade::class,

Route::group(['middleware' => 'language'], function () {

    // Here your routes

});

@foreach (language()->allowed() as $code => $name)
    <a href="{{ language()->back($code) }}">{{ $name }}</a>
@endforeach

{{ route('language::back', ['locale' => $code]) }}

{{ route('language::home', ['locale' => $code]) }}

php artisan vendor:publish --tag=language

php artisan migrate
config/language.php
[$code => $name]
[$code => $name]
[$name => $code]
$name