PHP code example of lykegenes / laravel-locale-switcher

1. Go to this page and download the library: Download lykegenes/laravel-locale-switcher 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/ */

    

lykegenes / laravel-locale-switcher example snippets


$url = action_localized('SomeController@someFunction', ['your' => 'parameters']);
$url = route_localized('someNamedRoute', ['your' => 'parameters']);

$url = switch_locale('fr'); // URL of the French version of the current page.

HTML::ul(LocaleSwitcher::getEnabledLocales());
 php
Lykegenes\LocaleSwitcher\ServiceProvider::class,
 php
'LocaleSwitcher' => Lykegenes\LocaleSwitcher\Facades\LocaleSwitcher::class,
 php
\Lykegenes\LocaleSwitcher\Middleware\SwitchLocaleMiddleware::class,
 bash
php artisan vendor:publish --provider="Lykegenes\LocaleSwitcher\ServiceProvider" --tag=config