diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 52848a7ac..05a5724a7 100644 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rules; use Illuminate\View\View; +use Illuminate\Validation\ValidationException; final readonly class RegisteredUserController { @@ -43,6 +44,12 @@ public function store(Request $request): RedirectResponse 'g-recaptcha-response' => app()->environment('production') ? ['required', new Recaptcha($request->ip())] : [], ]); + if (app()->environment('production')) { + throw ValidationException::withMessages([ + 'email' => 'We have temporarily disabled registration due to spam. We will try to enable it as soon as possible.', + ]); + } + $user = User::create([ 'name' => $request->name, 'email' => $request->email,