1
1
<?php
2
2
3
3
use App\Models\ User ;
4
+ use DutchCodingCompany\LivewireRecaptcha\ ValidatesRecaptcha ;
4
5
use Illuminate\Auth\Events\ Registered ;
5
6
use Illuminate\Support\Facades\ Hash ;
6
7
use Livewire\Volt\ Component ;
7
8
use Illuminate\Validation\Rules\ Password ;
8
9
9
- new class extends Component
10
- {
10
+ new class extends Component {
11
11
public string $name = ' ' ;
12
12
public string $email = ' ' ;
13
13
public string $username = ' ' ;
14
14
public string $password = ' ' ;
15
+ public string $gRecaptchaResponse ;
15
16
17
+ # [ValidatesRecaptcha]
16
18
public function register (): void
17
19
{
18
20
$validated = $this -> validate ([
@@ -85,14 +87,18 @@ public function register(): void
85
87
</dl >
86
88
87
89
<div class =" mt-16 relative text-sm space-y-4 max-w-lg mx-auto" >
88
- <svg class =" absolute left-0 top-0 size-7 -translate-x-8 -translate-y-2 rotate-12 transform text-green-600" fill =" currentColor" viewBox =" 0 0 32 32" aria-hidden =" true" >
89
- <path d =" M9.352 4C4.456 7.456 1 13.12 1 19.36c0 5.088 3.072 8.064 6.624 8.064 3.36 0 5.856-2.688 5.856-5.856 0-3.168-2.208-5.472-5.088-5.472-.576 0-1.344.096-1.536.192.48-3.264 3.552-7.104 6.624-9.024L9.352 4zm16.512 0c-4.8 3.456-8.256 9.12-8.256 15.36 0 5.088 3.072 8.064 6.624 8.064 3.264 0 5.856-2.688 5.856-5.856 0-3.168-2.304-5.472-5.184-5.472-.576 0-1.248.096-1.44.192.48-3.264 3.456-7.104 6.528-9.024L25.864 4z" />
90
+ <svg
91
+ class =" absolute left-0 top-0 size-7 -translate-x-8 -translate-y-2 rotate-12 transform text-green-600"
92
+ fill =" currentColor" viewBox =" 0 0 32 32" aria-hidden =" true" >
93
+ <path
94
+ d =" M9.352 4C4.456 7.456 1 13.12 1 19.36c0 5.088 3.072 8.064 6.624 8.064 3.36 0 5.856-2.688 5.856-5.856 0-3.168-2.208-5.472-5.088-5.472-.576 0-1.344.096-1.536.192.48-3.264 3.552-7.104 6.624-9.024L9.352 4zm16.512 0c-4.8 3.456-8.256 9.12-8.256 15.36 0 5.088 3.072 8.064 6.624 8.064 3.264 0 5.856-2.688 5.856-5.856 0-3.168-2.304-5.472-5.184-5.472-.576 0-1.248.096-1.44.192.48-3.264 3.456-7.104 6.528-9.024L25.864 4z" />
90
95
</svg >
91
96
<p class =" relative text-gray-600 dark:text-gray-400" >
92
97
{{ __ (' pages/auth.register.advantages.quote' ) } }
93
98
</p >
94
99
<p class =" mt-2 text-gray-900 dark:text-white" >
95
- <span class =" italic text-gray-400 dark:text-gray-500" >"The Pragmatic Programmer"</span > {{ __ (' pages/auth.register.advantages.quote_authors' ) } }
100
+ <span
101
+ class =" italic text-gray-400 dark:text-gray-500" >"The Pragmatic Programmer"</span > {{ __ (' pages/auth.register.advantages.quote_authors' ) } }
96
102
</p >
97
103
</div >
98
104
</div >
@@ -114,7 +120,7 @@ public function register(): void
114
120
115
121
<x-validation-errors />
116
122
117
- <form wire:submit =" register" class =" space-y-6" >
123
+ <form wire:submit =" register" wire:recaptcha class =" space-y-6" >
118
124
<div class =" space-y-3" >
119
125
<x-filament::input .wrapper >
120
126
<x-filament::input
@@ -167,12 +173,14 @@ public function register(): void
167
173
<div >
168
174
<x-buttons .primary type =" submit" class =" group w-full relative" >
169
175
<span class =" absolute inset-y-0 left-0 flex items-center pl-3" >
170
- <x-untitledui-lock class =" size-5 text-green-500 group-hover:text-green-600" aria-hidden =" true" />
176
+ <x-untitledui-lock class =" size-5 text-green-500 group-hover:text-green-600"
177
+ aria-hidden =" true" />
171
178
</span >
172
179
{{ __ (' pages/auth.register.submit' ) } }
173
180
</x-buttons .primary >
174
181
</div >
175
182
</form >
183
+ @livewireRecaptcha
176
184
</div >
177
185
178
186
@include (' partials._socials-link' )
0 commit comments