PHP code example of shureban / laravel-localization

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

    

shureban / laravel-localization example snippets


Shureban\LaravelLocalization\LocalizationServiceProvider::class,
shell
php artisan vendor:publish --provider="Shureban\LaravelLocalization\LocalizationServiceProvider"
 php
protected $middleware = [
    ...
    \Shureban\LaravelLocalization\Localization::class
];
 php
protected $middlewareGroups = [
    'web' => [
        ...
        \Shureban\LaravelLocalization\Localization::class
    ]
];
 php
protected $routeMiddleware = [
    ...
    'localization' => \Shureban\LaravelLocalization\Localization::class
];
 php
Route::middleware(['localization'])->get('/', [AnyController::class, 'method']);