Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@koyablue
Created November 4, 2021 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koyablue/fd3a74cc91d52ece76a6a23a2fa23c83 to your computer and use it in GitHub Desktop.
Save koyablue/fd3a74cc91d52ece76a6a23a2fa23c83 to your computer and use it in GitHub Desktop.
<?php
use App\Packages\FrontPage\Home\Presentation\Controllers\HomeController;
use App\Packages\FrontPage\Home\Presentation\Controllers\LocaleController;
use Illuminate\Support\Facades\Route;
//多言語化のためのmiddlewareを全体に適用
Route::group(['middleware' => 'set.locale'], function () {
//言語変更
Route::get('/lang/{locale}', [LocaleController::class, 'setLocaleSession'])->name('locale.set');
Route::get('/', [HomeController::class, 'index'])->name('home');
//略
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment