PHP code example of zymawy / localizer

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

    

zymawy / localizer example snippets


Aitor24\Localizer\LocalizerServiceProvider::class,

'Localizer'   => Aitor24\Localizer\Facades\LocalizerFacade::class,

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

    // Here your routes

});

@foreach (Localizer::allowedLanguages() as $code => $value)
    <a href="{{ Localizer::setRouteHome($code) }}">{{ $value }}</a>
@endforeach

{{ route('localizer::setLocale', ['locale' => $code]) }}

{{ route('localizer::setLocaleHome', ['locale' => $code]) }}

php artisan vendor:publish --tag=localizer_config

php artisan vendor:publish --tag=localizer_languages

php artisan vendor:publish --tag=localizer_migrations

php artisan migrate