@@ -244,38 +244,75 @@ It's recommended to include reCAPTCHA v3 on every page which can help you get th
244
244
245
245
#### Blade for Form & Action
246
246
247
- Include div with an ID inside your form, e.g.
247
+ There are three methods to populate the reCAPTCHA within the form.
248
+
249
+ - render() and renderOne() can be placed in anywhere.
250
+ - renderField() needs always to be placed within your form.
251
+
252
+ Method one - render():
248
253
249
- ``` html
250
- <div id =" contact_us_id" ></div >
251
254
```
255
+ [
256
+ $id=>$action , $id=>$action ...
257
+ ]
252
258
253
- Include GoogleReCaptchaV3::render() script after your form, params should follow 'ID'=>'Action', e.g.
259
+ {!! GoogleReCaptchaV3::render(['contact_us_id'=>'contact_us', 'signup_id'=>'signup']) !!}
260
+ ```
254
261
255
262
``` html
256
- {{--if laravel version <=5.6, please use {{ csrf_field() }}--}}
257
-
258
263
<form method =" POST" action =" /verify" >
259
- @csrf
260
- <div id =" contact_us_id" ></div >
264
+ <div id =" contact_us_id" ></div > // add div with id
261
265
<input type =" submit" value =" submit" >
262
266
</form >
263
267
264
268
265
269
<form method =" POST" action =" /verify" >
266
- @csrf
267
270
<div id =" signup_id" ></div >
268
271
<input type =" submit" value =" submit" >
269
272
</form >
270
273
271
274
{!! GoogleReCaptchaV3::render(['contact_us_id'=>'contact_us', 'signup_id'=>'signup']) !!}
272
275
273
- // or
276
+ ```
277
+
278
+ Method two - renderOne():
279
+
280
+ ```
281
+ GoogleReCaptchaV3::renderOne($id,$action);
282
+
283
+ {!! GoogleReCaptchaV3::renderOne('contact_us_id','contact_us') !!}
284
+ ```
285
+
286
+ ``` html
287
+ <form method =" POST" action =" /verify" >
288
+ <div id =" contact_us_id" ></div > // add div with id
289
+ <input type =" submit" value =" submit" >
290
+ </form >
291
+
292
+ {!! GoogleReCaptchaV3::renderOne('contact_us_id','contact_us') !!}
274
293
275
- {!! GoogleReCaptchaV3::renderOne('contact_us_id','contact_us') !!} // renderOne($id,$action)
276
294
```
277
295
278
296
297
+ Method three - renderField():
298
+
299
+ ```
300
+ GoogleReCaptchaV3::renderField($id,$action,$class,$style)
301
+
302
+ {!! GoogleReCaptchaV3::renderField('contact_us_id','contact_us_action') !!}
303
+ ```
304
+
305
+
306
+ ``` html
307
+
308
+ <form method =" POST" action =" /verify" >
309
+ {!! GoogleReCaptchaV3::renderField('contact_us_id','contact_us_action') !!}
310
+ <input type =" submit" value =" submit" >
311
+ </form >
312
+
313
+
314
+ ```
315
+
279
316
### Badge Display for Form & Action
280
317
281
318
If your settings were not reflected, please run php artisan config: cache to clear cache.
0 commit comments