PHP code example of jiordiviera / inertia-localize

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

    

jiordiviera / inertia-localize example snippets


use Illuminate\Support\Facades\Route;
use InertiaLocalize\Http\Controllers\LocaleController;
use InertiaLocalize\Http\Middleware\SetLocale;

Route::post('/locale', LocaleController::class)->name('locale.switch');

Route::middleware(SetLocale::class)->group(function () {
    Route::get('/', HomeController::class);
});
sh
php artisan vendor:publish --tag=inertia-localize-config