diff --git a/src/app/Http/Controllers/ProfileController.php b/src/app/Http/Controllers/ProfileController.php new file mode 100644 index 0000000..702ac8a --- /dev/null +++ b/src/app/Http/Controllers/ProfileController.php @@ -0,0 +1,27 @@ +username); + $output = $useCase->show($input); + + return view('profile', [ + 'username' => $output->username, + 'email' => $output->email, + ]); + } +} diff --git a/src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCase.php b/src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCase.php new file mode 100644 index 0000000..7505910 --- /dev/null +++ b/src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCase.php @@ -0,0 +1,23 @@ +username); + $authUser = $this->userRepository->findByUsername($username); + + return new ShowUserProfileUseCaseOutput($authUser->username(), $authUser->email()); + } +} diff --git a/src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCaseInput.php b/src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCaseInput.php new file mode 100644 index 0000000..2c6f74c --- /dev/null +++ b/src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCaseInput.php @@ -0,0 +1,12 @@ +プロフィール + + + +

ダッシュボードへ戻る

+@endsection diff --git a/src/routes/web.php b/src/routes/web.php index c932c0a..0c8b843 100644 --- a/src/routes/web.php +++ b/src/routes/web.php @@ -4,6 +4,7 @@ use App\Http\Controllers\LoginController; use App\Http\Controllers\LogoutController; +use App\Http\Controllers\ProfileController; use App\Http\Controllers\RegisterController; use Illuminate\Support\Facades\Route; @@ -28,5 +29,6 @@ Route::group(['middleware' => 'auth'], static function () { Route::view('/dashboard', 'dashboard')->name('dashboard'); + Route::get('/profile', ProfileController::class)->name('profile'); Route::post('/logout', LogoutController::class)->name('logout'); });