greggilbert / recaptcha Goto Github PK
View Code? Open in Web Editor NEW[ABANDONED] reCAPTCHA Validator for Laravel 5
License: MIT License
[ABANDONED] reCAPTCHA Validator for Laravel 5
License: MIT License
Hello!
I tried to use your plugin with dynamic generated contents ( js -> ajax -> php render tpl with reCaptcha -> respnse to frontend -> frontend opens a modal with respons html string ) but unfortunately it doesn't works.
It's not really a issue someone can help me? I got this error?
ErrorException in CheckRecaptchaV2.php line 41:
file_get_contents(): SSL: Connection reset by peer
Hi,
I'm using laravel 5 and wanted to use Recaptcha2.
I have installed it but it seems php artisan vendor:publish does nothing. I do not see recaptcha config in my config folder.
Btw when I use {!! Recaptcha::render() !!}
This error is shown:
ErrorException in Recaptcha.php line 26:
array_merge(): Argument #1 is not an array
Kindly check. Thank you.
I try to use this package but i got some problems on validate
This is my code:
$validate = Validator::make(
array('recaptcha_response_field' => 'required|recaptcha')
);
if ($validate->fails())
{
echo $validate->messages();
}
I got some errors. How do i validate the rechaptcha?
Thanks.
How do I use of custom captcha?
Hi,
I've tried this and I got this error :
Using $this when not in object context
Symfony\Component\Debug\Exception\FatalErrorException
โฆ\vendor\greggilbert\recaptcha\src\Greggilbert\Recaptcha\RecaptchaServiceProvider.php:67
I installed your package and it's working great except for 1 little thing, you should add an option for https (secure), instead of just hard coding the address "http://www.google.com/recaptcha/api" which is inside your file 'captcha.blade.php'
I would be happy with something like this:
Inside 'config.php':: 'httpPrefix' => 'https' //or http
Inside 'captcha.blade.php':: src={{ $httpPrefix }}//www.google.....
Apart from that, the rest is working as it should... great job :)
How can we reset the captcha when the form is reset via the reset button?
Can it be added to the behavior to work with the reset button?
Hello,
How about changing the repo's description to contain "Laravel 5" instead of "Laravel 4"? ๐
Ignore.
Please add lumen support
Hello,
Getting a fatal error thrown when validating a captcha.
BadMethodCallException
Method [validateCaptcha] does not exist.
I added the correct provider to my app/config/app.php and displaying the captcha works fine.
Thanks in advance.
Thanks for the nice module
I am using your module. i want to validate recaptcha on ajax request. but how to refresh captcha if captcha it's not validated.
Response will be appreciated.
hi
i use recaptcha 1.1.5 with laravel 4 and this work fine ...
but on inputs validation return that recaptcha is wrong ...
how i can fix this ???
Any chance this will be fixed soon?
Hello,
Thank you for this great package.
From what I understand, you fetch the "recaptcha_challenge_field" from the input data.
What if there is no input (cause Laravel didn't generate the dom/html) and we simply want to pass a new "recaptcha_challenge_field" value to the model.
Maybe, it will be nice, if the package also checks for a valid attribute in the model ($model-> recaptcha_challenge_field).
Just a thought :)
Its never a good idea to modify the core language file, as it requires additional work to "upgrade" to the latest core version.
It is possible for a package to have its own language files, which makes the installation/maintenance a little easier :)
recaptcha is not displaying in the form. when you view the source it shows it was implemented but the data-sitekey attribute it empty.
I did fill them in, in the config.
Is there a way to change the placeholder text of the entry box to handle different languages? Something like specifying the language file.key to use for the text. A quick glance at the code suggests this is not configured at this time - is this correct?
Every time in use it is showing the same output as : The recaptcha response field field is not correct. Even if it is correct ... (tested and reinstalled multiple times)
I have done all that you said to do in the README but after going through test after test i have found that it does not actually verify and still allows the user to register even if they input the wrong recaptcha.
Hi is it possible to use 2 recaptcha on one page in two different forms?
Hello,
I want use "captcha" field name instead of "g-recaptcha-response" , how i can edit it in laravel 4 ?
Thanks in advance.
When using
echo Form::captcha();
in my view this results in an exception:
Warning: Missing argument 2 for Illuminate\Html\FormBuilder::input()
upgrade compatibility to support Laravel 5.1.x
I've just downloaded your package, followed what to do line by line; with laravel 4.1
But once I add {{ Form::captcha() }} it just gives me this fatal error
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class ' Form' not found
please is this package comptabile with Laravel 4.1 ? if yes how can I solve this problem and use your package ?
Thank you very much
Hello,
I have following issue:
'BadMethodCallException' with message 'Method [validateCaptcha] does not exist.' in /vendor/laravel/framework/src/Illuminate/Validation/Validator.php:2547
I am using 1.1.5 version for laravel 4, can you help me with this?
I am not sure if this is a recaptcha issue or an issue with this plugin. However, I add in the captcha field with {{ Form::captcha(); }} and the new NoCaptcha shows up just fine. The tool works and it verifies that I am human. However, when I send it along to my laravel backend the g-recaptcha-response is not sent along.
I checked the form and the g-recaptcha-response field is THERE it just never gets filled with anything. Any ideas?
Hi,
I've got very strange problem on one site using your library.
After uploading to server everything works well, after a few minutes (random) it stops. I've got exception: production.ERROR: exception 'ErrorException' with message 'trim() expects parameter 1 to be string, array given' at /vendor/greggilbert/recaptcha/src/Greggilbert/Recaptcha/RecaptchaServiceProvider.php:80
However if I upload RecaptchaServiceProvider again to server it starts to work again for a while.
I compared the RecaptchaServiceProvider before and after issue and it's the same!
Any ideas what could be wrong?
Thanks in advance for assistance.
Regards,
Maciej Matecki
This does not work:
{{ Form::captcha(array('options' => array('lang' => $language ) ) ) }}
I have a laravel 5 . I got following error '[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Greggilbert\Recaptcha\RecaptchaServiceProvider' not found' when run this command "php artisan vendor:publish".
Code:
$validator = Validator::make(
array(
//'username' => Input::get('username'),
//'email' => Input::get('email'),
//'password' => Input::get('password'),
'g-recaptcha-response' => Input::get('g-recaptcha-response'),
),
array(
// 'username' => 'required|alpha_num|unique:users',
// 'email' => 'required|email|unique:users',
//'password' => 'required|min:5',
'g-recaptcha-response' => 'required|recaptcha',
)
);
This is on Laravel 4.2, using curl driver and recaptcha v2.
Recently, google made their new version of reCAPTCHA live. It uses a totally new system for validation. The user first clicks a checkbox widget which pops up the challenge and response section. When they click 'validate', the response is then put into a hidden textarea
element and submitted along with the rest of your AJAX or POST data (see https://developers.google.com/recaptcha/docs/verify). You can then check via laravel rules based on your secret and the response, similar to how you do it now, but you only need to use a simple GET request (so you can use file_get_contents()
directly to a URL instead of the fsocket request). You no longer have to specify the challenge itself, it's all one giant hash value now.
It would be cool if this were updated to support the new version. I was all set to use your repo in my latest project, but they they suddenly switched up their system.
Although you included the info that Laravel 4.x users have to use the old 1.x branch, you removed the information how to display the captcha on that version.
I checked if you could use the following function in Larvavel 4.2
{{ Recaptcha::render() }}
but it didn't work. Maybe you should add the advice in your Readme.md that Laravel 4.x users / Branch 1.x users have to use the old function
{{ Form::captcha() }}
to get their pages working.
Hi,
Great package, I have one question regarding using it with a mass assigned user model. I get an error like this on form submit:
Column not found: 1054 Unknown column 'recaptcha_challenge_field' in 'field list'
(SQL: insert into `users` (`first_name`, `last_name`, `email`, `password`, `gender`,
`height`, `weight`, `date_of_birth`, `city`, `country`, `recaptcha_challenge_field`,
`recaptcha_response_field`, `updated_at`, `created_at`)
I think I need to remove the fields protected 'recaptcha_challenge_field' and 'recaptcha_response_field' from assignment and have tried adding them to 'protected $hidden' with no luck.
Any light you can shed on this much appreciated - and it might be worth adding to the install docs for Laravel newbies like me.
Thanks again!
Here is a good guide on how to resize the recaptcha: https://www.geekgoddess.com/how-to-resize-the-google-nocaptcha-recaptcha/
But It doesn't work when passing the parmeters in the "render" method, because they are not added to the recaptcha div tag. Sure I can solve that with a few lines of css, but it would be cool to integrate that into the package somehow :) ๐
I've got an issue where the curl driver is simply returning false
.
The native driver is working fine though.
Any ideas?
all default package configs.
php 5.5.9-1ubuntu4.5
Hi, I am just wondering if your or anyone else have managed to have multiple instances of recaptcha on the same page?
I think it is probably a limitation with Recaptcha. If you have two with this package you get the following error:
Cannot redeclare renderDataAttributes()
I've tried tweaking the code and also I've tried using another package to test and it only one recaptcha appears.
It would be great if we could do this.
Cheers and thanks for the awesome package.
Hi there. I've come here to seek a potential solution to an issue I have. I am running Laravel 4 with the packages:
https://github.com/Zizaco/confide and https://github.com/greggilbert/recaptcha
All the code was fine up to when I added the reCAPTCHA package. When I did, I received this error: http://prntscr.com/478hzd
Here's how I added the package.
public static $rules = array(
'username' => 'required|alpha_dash|unique:users',
'email' => 'required|email|unique:users',
'password' => 'required|min:4|confirmed',
'password_confirmation' => 'min:4',
'recaptcha_response_field' => 'required|recaptcha', // I added this line.
);
<div class="form-group">
{{ Form::captcha() }}
</div>
I can confirm that the public and private keys are correct. Everything has been configured fine. Perhaps it may be that this is being coded incorrectly? Please let me know if you have any ideas. Many thanks.
Hello,
im using Laravel 4.2.
Im trying to setup recaptcha and i get this error
"ErrorException
Method captcha does not exist."
ive run php artisan dump-autoload but nothing changed
In some places, like here, you use CaptchaInterface
, but the actual class is called RecaptchaInterface
.
I added the options in the config.php file
'options' => [
'lang' => 'es'
]
I can see in the view the JavaScript Object RecaptchaOptions is
var RecaptchaOptions = {"lang":"es"};
But the translation doesn't work
Any ideas?
ReCaptcha offers ways of customizing how the widget looks like language/theme wise.
It's totally possible that I'm doing something wrong, but I recently got a bug report for CheckRecaptcha.php on line 42 yielding a Laravel Orange Screen of Death with the message "Class 'Greggilbert\Recaptcha\Exception' not found".
Does the Exception there just need a backslash preceding it?
Thanks for the plugin!
Hello,
What about to call the javascript file with async?,
so the script is non-blocking the page load
<script type="text/javascript" async src="//www.google.com/recaptcha/api/challenge?k=<?php echo $public_key ?><?php echo (isset($lang) ? '&hl='.$lang : '') ?>"></script>
or add an option to allow async
Cheers,
J.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.