This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Packages\FrontPage\Home\Presentation\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use App\Packages\FrontPage\Shared\UseCase\LocaleSessionInterface; | |
class SetLocaleMiddleware | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Packages\FrontPage\Home\Presentation\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Controllers\Controller; | |
use App\Packages\FrontPage\Home\UseCase\SetLocaleUseCase; | |
class LocaleController extends Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Packages\FrontPage\Home\UseCase; | |
use App\Packages\FrontPage\Shared\Domain\Models\Locale; | |
use App\Packages\FrontPage\Shared\UseCase\LocaleSessionInterface; | |
class SetLocaleUseCase | |
{ | |
private LocaleSessionInterface $localeSession; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Packages\FrontPage\Shared\Presentation\Dto; | |
class GetLocaleSessionResponse | |
{ | |
public string $locale; | |
public function __construct(string $locale) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Packages\FrontPage\Shared\Presentation; | |
use App\Packages\FrontPage\Shared\UseCase\LocaleSessionInterface; | |
use App\Packages\FrontPage\Shared\Domain\Models\Locale; | |
use App\Packages\FrontPage\Shared\Presentation\Dto\GetLocaleSessionResponse; | |
class LocaleSession implements LocaleSessionInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Packages\FrontPage\Shared\UseCase; | |
use App\Packages\FrontPage\Shared\Domain\Models\Locale; | |
use App\Packages\FrontPage\Shared\Presentation\Dto\GetLocaleSessionResponse; | |
interface LocaleSessionInterface | |
{ | |
public function getLocaleSessionKey(): string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Packages\FrontPage\Shared\Domain\Models; | |
use InvalidArgumentException; | |
class Locale | |
{ | |
private const LOCALE = [ | |
'en', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
└── projdir | |
├── app | |
│ ├── (略) | |
│ ├── Packages | |
│ │ ├── AdminPage | |
│ │ ├── FrontPage | |
│ │ │ ├── Appointment | |
│ │ │ ├── Contact | |
│ │ │ ├── Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# xxのビルド済みCSS, JSファイルと画像ファイルをバックエンドのLaravelのpublic以下にコピーする用 | |
# FRONT_SRC_BASE_DIRは自分の環境に合わせて適宜書き換え | |
FRONT_SRC_BASE_DIR="/path/to/front/src" | |
# BACKEND_PUBLIC_DIRは自分の環境に合わせて適宜書き換え | |
BACKEND_SER_BASE_DIR="/path/to/backend/src" | |
# フロントエンドのリポジトリでcheckoutするブランチ名 | |
BRANCH_TO_CHECKOUT="stag" |
NewerOlder