Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with Livewire #91

Open
titantwentyone opened this issue Jan 14, 2022 · 0 comments
Open

Usage with Livewire #91

titantwentyone opened this issue Jan 14, 2022 · 0 comments

Comments

@titantwentyone
Copy link

Thank you for creating this package. I am hoping to use this within a Livewire component and wondering whether there are any special considerations to take into account.

My use case is with a registration form. In my Livewire components blade file, I have:

<div>
    @push('footer-scripts')
    {!!  GoogleReCaptchaV3::init() !!}
    @endpush

    <form wire:submit.prevent="submit">
        {!!  GoogleReCaptchaV3::renderField('registration_id','registration') !!}
        
        <label class='text-white mb-2'>Name(*)</label>
        <input type="text" name="name" class='si_field' wire:model="name">

        {{-- remainder of registration fields here--}}
        
        <button>Submit</button>

    </form>
</div>

When the above is rendered, I can see the scripts from the package render (functions refreshReCaptchaV3(fieldId,action) and getReCaptchaV3Response(fieldId) but there is no entry for the api js from Google (i.e. <script src="https://www.google.com/recaptcha/api.js?render=my_site_key"></script>-) and the badge does not display.

Any pointers on the best way to use this package with Livewire? Apologies in advance if I have missed something very obvious!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant