From 94f53583ae06d2fd882b292a2f486b97ef9df91f Mon Sep 17 00:00:00 2001 From: ucan-lab <35098175+ucan-lab@users.noreply.github.com> Date: Fri, 30 Jun 2023 19:03:37 +0900 Subject: [PATCH] Profile --- .../Http/Controllers/ProfileController.php | 27 +++++++++++++++++++ .../ShowUserProfileUseCase.php | 23 ++++++++++++++++ .../ShowUserProfileUseCaseInput.php | 12 +++++++++ .../ShowUserProfileUseCaseOutput.php | 14 ++++++++++ src/resources/views/profile.blade.php | 14 ++++++++++ src/routes/web.php | 2 ++ 6 files changed, 92 insertions(+) create mode 100644 src/app/Http/Controllers/ProfileController.php create mode 100644 src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCase.php create mode 100644 src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCaseInput.php create mode 100644 src/packages/Acme/Application/ShowUserProfile/ShowUserProfileUseCaseOutput.php create mode 100644 src/resources/views/profile.blade.php 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'); });