jhon-jhones
jhon-jhones

Reputation: 515

google recaptcha v2 in livewire component comes with issues

I'm trying to implement google recaptcha v2 with livewire but I get some issues :

The issue that I get is when I try to call RECAPTCHA_SITE_KEY from the .env file it display me this error message in Dev Console :

"Uncaught Error: Missing required parameters: sitekey"

it confusing because the site key is correct and is already exist inside .env file.

Wile I remove the {{ env('RECAPTCHA_SITE_KEY') }} from data-sitekey and add the site key it work

Not Working example :

data-sitekey="{{ env('RECAPTCHA_SITE_KEY') }}"

"Uncaught Error: Missing required parameters: sitekey"

Working example :

data-sitekey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

Where this problem coming from ?

Upvotes: 0

Views: 499

Answers (1)

user3208715
user3208715

Reputation: 1

First, double check that is is spelled exactly the same in your .env. Second, run php artisan cache:clear in case your config is cached. Third, attempt env('RECAPTCHA_SITE_KEY'); from php artisan tinker and see what results you get.

Upvotes: 0

Related Questions