From 183c1cad4362d16684c59b0e4e03953e876fd24e Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Wed, 15 May 2024 19:47:32 -0400 Subject: [PATCH] use invokable controllers --- routes/web.php | 6 +++--- src/Http/Controllers/User/PasswordController.php | 2 +- src/Http/Controllers/User/ProfileController.php | 2 +- src/Http/Controllers/User/RegisterController.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/routes/web.php b/routes/web.php index 6d9f9e2f08..5f2755063f 100755 --- a/routes/web.php +++ b/routes/web.php @@ -34,9 +34,9 @@ Route::group(['middleware' => [HandlePrecognitiveRequests::class]], function () { Route::post('login', [LoginController::class, 'login'])->name('login'); - Route::post('register', [RegisterController::class, 'register'])->name('register'); - Route::post('profile', [ProfileController::class, 'profile'])->name('profile'); - Route::post('password', [PasswordController::class, 'password'])->name('password'); + Route::post('register', RegisterController::class)->name('register'); + Route::post('profile', ProfileController::class)->name('profile'); + Route::post('password', PasswordController::class)->name('password'); }); Route::post('password/email', [ForgotPasswordController::class, 'sendResetLinkEmail'])->name('password.email'); diff --git a/src/Http/Controllers/User/PasswordController.php b/src/Http/Controllers/User/PasswordController.php index a817cb104b..1b15bdd78b 100644 --- a/src/Http/Controllers/User/PasswordController.php +++ b/src/Http/Controllers/User/PasswordController.php @@ -7,7 +7,7 @@ class PasswordController { - public function password(UserPasswordRequest $request) + public function __invoke(UserPasswordRequest $request) { $user = User::current(); diff --git a/src/Http/Controllers/User/ProfileController.php b/src/Http/Controllers/User/ProfileController.php index 33872cd886..656d1226df 100644 --- a/src/Http/Controllers/User/ProfileController.php +++ b/src/Http/Controllers/User/ProfileController.php @@ -7,7 +7,7 @@ class ProfileController { - public function profile(UserProfileRequest $request) + public function __invoke(UserProfileRequest $request) { $user = User::current(); diff --git a/src/Http/Controllers/User/RegisterController.php b/src/Http/Controllers/User/RegisterController.php index abdbbeeaa0..36114fd044 100644 --- a/src/Http/Controllers/User/RegisterController.php +++ b/src/Http/Controllers/User/RegisterController.php @@ -14,7 +14,7 @@ class RegisterController { - public function register(UserRegisterRequest $request) + public function __invoke(UserRegisterRequest $request) { $user = User::make() ->email($request->email)