Skip to content

Commit 824feb0

Browse files
wip
1 parent 2f3ef2c commit 824feb0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Add the reCAPTCHA script to your Blade templates using the `@recaptcha` directiv
128128
- `Badge::INLINE` - Displays the badge inline
129129
- `Badge::BOTTOMLEFT` - Displays the badge at the bottom left
130130
- `Badge::BOTTOMRIGHT` - Displays the badge at the bottom right (recommended)
131+
- `Badge::HIDDEN` - Hides the badge completely
131132

132133
### Backend Validation
133134

src/GoogleRecaptchaV3.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Maize\GoogleRecaptchaV3\Enums\Badge;
88
use Maize\GoogleRecaptchaV3\Rules\RecaptchaRule;
99
use Maize\GoogleRecaptchaV3\Support\Config;
10+
use Illuminate\Support\Uri;
1011

1112
class GoogleRecaptchaV3
1213
{
@@ -24,7 +25,9 @@ public function boot(): void
2425
private function getJsScriptUrl(Badge $badge): string
2526
{
2627
return Config::getBaseJsScriptUrl()
27-
->withQuery(['badge' => $badge])
28+
->when($badge !== Badge::HIDDEN, fn (Uri $url) => (
29+
$url->withQuery(['badge' => $badge])
30+
))
2831
->value();
2932
}
3033

0 commit comments

Comments
 (0)