Giter VIP home page Giter VIP logo

laravel-google-captcha's People

Contributors

alexvtua avatar briareos17 avatar fdjkgh580-2 avatar gdejong avatar laravel-shift avatar mshoaibdev avatar poket-jony avatar powolnymarcel avatar smartameer avatar thinhbuzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-google-captcha's Issues

Update readme

Remove call to Form facade

{!! Form::captcha($attributes) !!}

because Form removed from Laravel 5

Passing post tests?

Read the testing instructions which work well if you are testing forms but what about testing using a simple post request? Thanks in advance for the help!

Eg:

$this->post('/register', [
            'username' => 'TestUser',
            'email' => '[email protected]',
            'password' => 'Password123',
            'password_confirmation' => 'Password123',
            'terms' => '1',
        ]);

        $this->assertDatabaseHas('users', [
            'email' => '[email protected]',
            'username' => 'TestUser',
        ]);

Multiple captcha on same page

Hello,

I would like to add multiple captcha on multiple form but on the same page.
The problem is that the captcha JS file will be loaded X times as i include it one page instead of loading only one time.

I use this in my template : {!! Captcha::display([]) !!}

Someone already got this problem ?

Thanks

file_get_contents() error not fixed at all?

Laravel: 5.6
PHP: 7.2
"name": "buzz/laravel-google-captcha",
"version": "v2.1.10",

file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0

[2019-01-23 10:05:41] production.ERROR: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 {"exception":"[object] (ErrorException(code: 0): file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 at /var/www/example.com/releases/6/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php:72)

file_get_contents() error

hi i am using laravel 5.4. to google reCaptcha, i am facing an error

file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0

how to define 'request_method' ?

if i set 'request_method' => CurlPost or 'request_method' => "CurlPost' or 'request_method' => 'Curl' it showing Function CurlPost() does not exist.

thanks

Update test documentation for multiple captchas on a single page

Hi there,

Let me start off by saying that I am very thankful for your recent update to this library to support multiple captchas on a single page!

I found however that I needed to update my integration tests as well with those new changes, and was wondering if this could be updated in the docs?

I have added three calls to my tests, could you tell me if this is the correct way to go? The first 2 shouldReceive calls are already documented by you. This is for testing a page that is using multiple captchas.

// prevent validation error on captcha
        CaptchaFacade::shouldReceive('verify')
            ->andReturn(true);
            
// provide hidden input for your 'required' validation
        CaptchaFacade::shouldReceive('display')
            ->andReturn('<input type="hidden" name="g-recaptcha-response" value="1" />');

CaptchaFacade::shouldReceive("displayJs");
CaptchaFacade::shouldReceive("displayMultiple");
CaptchaFacade::shouldReceive("multiple");

Cheers

Does not reset multi captcha

js output

<script type="text/javascript">
var buzzNoCaptchaWidgetIds={};
var buzzNoCaptchaOnLoadCallback=function( {
buzzNoCaptchaWidgetIds["captcha_create_comment"]=grecaptcha.render('captcha_create_comment',
{"sitekey":"6LdVmDEUAAAAABEyMLp_V2Yr52KOYC19aovieDuE", "id":"captcha_create_comment"}
);
buzzNoCaptchaWidgetIds["captcha_create_consultation"]=grecaptcha.render('captcha_create_consultation',
{"sitekey":"6LdVmDEUAAAAABEyMLp_V2Yr52KOYC19aovieDuE","id":"captcha_create_consultation"}
);
buzzNoCaptchaWidgetIds["captcha_create_appointment"]=grecaptcha.render('captcha_create_appointment',
{"sitekey":"6LdVmDEUAAAAABEyMLp_V2Yr52KOYC19aovieDuE","id":"captcha_create_appointment"}
);
};</script>

I execute in the console

grecaptcha.reset(buzzNoCaptchaWidgetIds['captcha_create_consultation']);

As a result, the first captcha in the list of objects is reset (id captcha_create_comment)
Works as I understood on the same principle as before: the first counter is reset

Documentation typo

{!! app('captcha')->display($attributes = [], $options = ['lang'=> 'vi'); !!}

Should be

{!! app('captcha')->display($attributes = [], $options = ['lang'=> 'vi']) !!}

At Usage\With custom language support

example reset captcha

Please give an example of how you reset the captcha if there are several of them on the page. I have not tried it all the same.

Support for invisible reCAPTCHAs

Are invisible reCAPTCHAs supported through this library?

I tried to use this library with the invisible data attribute (see v2 reCAPTCHA docs by Google):

{!! Captcha::display(['data-size' => 'invisible']) !!}

While this line hides the captcha, it also causes the validation to fail afterwards. Looking at Google documentation this flag should be the only change needed, but I can not figure out, why it does not work with this plugin. Any ideas? Or, maybe anybody here activly uses the invisible reCAPTCHAs already with this library?

Fatal Error Undefined Constant

Fatal error: Undefined constant 'Buzz\LaravelGoogleCaptcha\CaptchaServiceProvider'
from the readme, chaging this
'Buzz\LaravelGoogleCaptcha\CaptchaServiceProvider',
to this
Buzz\LaravelGoogleCaptcha\CaptchaServiceProvider::class, seems to fix the problem.

How to Set proxy in Laravel for buzz/laravel-google-captcha

How to set the proxy for calling buzz/laravel-google-captcha

return [
'secret' => env('CAPTCHA_SECRET', 'default_secret'),
'sitekey' => env('CAPTCHA_SITEKEY', 'default_sitekey'),
/**
* @var string|null Default null.
* Custom with function name (example customRequestCaptcha) or class@method (example \App\CustomRequestCaptcha@custom).
* Function must be return instance, read more in folder examples
*/
'request_method' => null,
'options' => [
'multiple' => false,
'lang' => app()->getLocale(),
],
'attributes' => [
'theme' => 'light'
],
];

please help asap

VueJs Conflict: script tag inside template

I get an error when adding Captcha::display() to my view

Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed

Because of <script> tag that has been injected along with captcha div. I've already tried to set multiple to true in config and adding Captcha::displayJs() in the end of <body> tag. It requires to create a <script> tag with callback buzzNoCaptchaOnLoadCallback() function inside that script and still not showing captcha (but eliminates the error message on loading)

Captcha don't validate

Hello,
I followed all the steps in readme.md, but captcha validation is not running, could you help me or explain to me how validation works?
I'm new to laravel, so I still don't understand some parts of the framework

Testing inside Laravel Dusk

I am running Dusk automation tests and none of this seem to work:

   public function createApplication(): Application
    {
        ...
        $app['validator']->extend('captcha', function() {
            fwrite(STDOUT, print_r("Bypassing captcha validation and returning explicit true!\n", TRUE));
            return true;
        });

        CaptchaFacade::shouldReceive('verify')->andReturn(true);
        CaptchaFacade::shouldReceive('display')
            ->andReturn('<input type="hidden" name="g-recaptcha-response" value="1" />');

        return $app;
    }

The error message is Failed to validate the captcha. How to sort it?
image

I think it is not working with laravel 5.3

here is the errors i got while trying to require it

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for buzz/laravel-google-captcha ^1.2 -> satisfiable by buzz/laravel-google-captcha[v1.2].
- Conclusion: remove laravel/framework v5.3.15
- Conclusion: don't install laravel/framework v5.3.15
- buzz/laravel-google-captcha v1.2 requires illuminate/support 5.0.|5.1.|5.2.* -> satisfiable by illuminate/support[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0.33, v5.0.4, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7].
- don't install illuminate/support v5.2.19|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.21|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.24|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.25|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.26|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.27|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.28|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.31|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.32|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.37|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.43|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.45|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.0.0|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.0.22|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.0.25|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.0.26|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.0.28|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.0.33|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.0.4|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.1|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.13|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.16|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.2|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.20|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.22|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.25|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.28|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.30|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.31|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.41|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.6|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.1.8|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.0|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.6|don't install laravel/framework v5.3.15
- don't install illuminate/support v5.2.7|don't install laravel/framework v5.3.15
- Installation request for laravel/framework (locked at v5.3.15, required as 5.3.*) -> satisfiable by laravel/framework[v5.3.15].

Installation failed, reverting ./composer.json to its original content.

fails() method are always true

I used of this rule to validate recaptcha:

$validate = Validator::make($request->all(), [
            'g-recaptcha-response' => 'required|captcha',
            'name' => 'required',
        ]);

But this way always return fail, even when i checked recaptcha

if ($validate->fails()) {
         var_dump($vlidate); 
         dd('fails');
}

When i checked passes() method is true and when i don't check, passes() return false, but in both sitiuation fails() method is true

L5.1 Call to undefined method Closure::__set_state()

Hi guys,

I'm working on laravel 5.1 and after updating the laravel-google-captcha to v2.1.6, I got an error on running php artisan command
image
I checked the bootstrap/cache/config.php and I got the code below:
image

Not sure what's wrong. Please advise.

Thanks and regards!

How to use different access keys?

Is there is a way how can I specify a different access key for the captcha?
One captcha on one page, another captcha on another page.
So we can track usage of it separately.

Having Trouble

So I started off running composer require buzz/laravel-google-captcha install went fine.

Im running laravel 5.4

Add ServiceProvider to the providers array in app/config/app.php.
'Buzz\LaravelGoogleCaptcha\CaptchaServiceProvider',
(seeing im 5.4 and this doesnt exist I did the following)

Add ServiceProvider to the providers array in config/app.php.
Buzz\LaravelGoogleCaptcha\CaptchaServiceProvider::class,

Then use Facade: add 'Captcha' => '\Buzz\LaravelGoogleCaptcha\CaptchaFacade', to the aliases array in app/config/app.php
(seeing im 5.4 and this doesnt exist I did the following)

Facade: add 'Captcha' => \Buzz\LaravelGoogleCaptcha\CaptchaFacade::class, to the aliases array in config/app.php

Then added my CAPTCHA_SECRET=[secret-key] CAPTCHA_SITEKEY=[site-key] with proper keys to my .env

Then placed {!! Captcha::display($attributes) !!} in my login.blade.php

When I goto login page I get the following error:
Undefined variable: attributes (View: /home/UNIT3D_2.0/resources/views/user/login.blade.php)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.