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

Update for multiple app('captcha')->display() on the same page #57

Merged
merged 4 commits into from
Jan 1, 2017
Merged

Update for multiple app('captcha')->display() on the same page #57

merged 4 commits into from
Jan 1, 2017

Conversation

seltix5
Copy link
Contributor

@seltix5 seltix5 commented Dec 31, 2016

with this update will be possible to just call the noRecaptcha on the same page without requesting the api multiple times, just like this :

app('captcha')->display()

registerin the service provider with singleton instead of bind will return always the same object per page load. with this methos is possible to insert a control variable in the class and use it to call the api only once.
ading this var control will permit to request the api only once. this will work with the singleton register on te serviceprovider file.
@anhskohbo
Copy link
Owner

Thanks for pull request, pls check my code review.

@anhskohbo anhskohbo merged commit f5befe2 into anhskohbo:master Jan 1, 2017
@anhskohbo
Copy link
Owner

I need test this pr before make a new release

@seltix5
Copy link
Contributor Author

seltix5 commented Jan 2, 2017

sure ^^

@anhskohbo
Copy link
Owner

Hi seltix5, could you give me a example about multiple widgets in a page?

See: https://developers.google.com/recaptcha/docs/display

@seltix5
Copy link
Contributor Author

seltix5 commented Jan 4, 2017

hi!
so, after furder checking this situation, i forget that the default google reCaptcha code will automatically render only the first div/instance, so i added a function to use the "explicit" mode, with this changes to request only one noCaptcha just call display :

{!! app('captcha')->display() !!}

when usign multipla instance we should call only the functio multiple_display like this :

{!! app('captcha')->multiple_display() !!}
.....
{!! app('captcha')->multiple_display() !!}

what do you think?

#58

Copy link
Owner

@anhskohbo anhskohbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

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

Successfully merging this pull request may close these issues.

None yet

2 participants