From eee25b8321ef3946eba351afc03b36ccd92d169b Mon Sep 17 00:00:00 2001 From: Jaton David Date: Tue, 29 Oct 2024 10:01:10 +0100 Subject: [PATCH] Unique user name --- app/Http/Controllers/Auth/RegisteredUserController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 0739e2e..77c9d3d 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -30,7 +30,7 @@ public function create(): View public function store(Request $request): RedirectResponse { $request->validate([ - 'name' => ['required', 'string', 'max:255'], + 'name' => ['required', 'string', 'max:255', 'Unique:'.User::class], 'email' => ['required', 'string', 'lowercase', 'email', 'max:255', 'unique:'.User::class], 'password' => ['required', 'confirmed', Rules\Password::defaults()], ]);