igoshev / laravel-captcha Goto Github PK
View Code? Open in Web Editor NEWCaptcha integration for the Laravel
Home Page: https://laravel.bonecms.tech/laravel-captcha
License: MIT License
Captcha integration for the Laravel
Home Page: https://laravel.bonecms.tech/laravel-captcha
License: MIT License
src/resources/lang
src/resources/lang
If you manually fill out the captcha and submit the form, as long as you don't load a new captcha, you can then use the same captcha code to post to the same URL unlimited times.
It seems like the validator for the Captcha should also clear the bone_captcha
session variable after validating the captcha, to avoid allowing the same code to be allowed multiple times.
As a workaround for my current project, I just manually wipe the bone_captcha
field after it validates successfully. Then the user is required to load the captcha image before supplying the code (which makes a lot of sense).
If for some reason it's difficult to clear the bone_captcha
session variable in the validator (I suppose this might be a backwards incompatibility issue, in the case that a project validates the captcha multiple times in a single request for some reason), then it should at least include in the examples in the readme that the bone_captcha
session vairable must be wiped after a successful validation.
src/resources/lang
src/resources/lang
Hello
First I would like to thank you for creating this very useful library.
So I tried using your library it shows the captcha but when I validate it fails,
did I miss out something?
I followed all the steps.
It seems the captcha code that was saved in the session was not retained during validation.
I am using Laravel 5.3
Regards,
Myles
I just updated my production server to php 8.1 and noticed, that the captcha is not working correctly anymore. For some reason it works locally, but takes about 5-8 seconds to load. Had no issue with php 8.0 before.
On my live server, I get the following exception and no image is being generated:
production.ERROR: Call to undefined function Igoshev\Captcha\Captcha\Generator\ImageTTFtext() {"exception":"[object] (Error(code: 0): Call to undefined function Igoshev\Captcha\Captcha\Generator\ImageTTFtext() at /home/xxx/webapps/xxx/releases/20220128154920/vendor/bonecms/laravel-captcha/src/Captcha/Generator/GeneratorWaves.php:30)
This package & its dependencies are no longer compatible with laravel 6.
Please resolve this issue.
Thanks
src/resources/lang
Hi , thanks for all the efforts contributed to build up this awesome package.
I was wondering where do these captcha image store, its store storage folder ? thanks
src/resources/lang
How can I save the current image to public directory?
Hi
I installed this package and published translation
Captcha and validation works perfectly but translation works only in view
Validation error is in default language (en)
I've changed the registerValidator in service provider to find the problem and it returns the locale is en
/** * Register captcha validator. */ protected function registerValidator() { Validator::extend(config('bone.captcha.validator'), function ($attribute, $value, $parameters, $validator) { return $this->app[Captcha::class]->validate($value); }, \App::getLocale()); }
....\bonecms\laravel-captcha\src\Providers\CaptchaServiceProvider.php
protected function registerValidator() { Validator::extend(config('bone.captcha.validator'), function ($attribute, $value, $parameters, $validator) { return $this->app[Captcha::class]->validate($value); }, trans('bone::captcha.incorrect_code')); }
This code not working for me
This code variant works:
protected function registerValidator() { Validator::extendImplicit(config('bone.captcha.validator'), function ($attribute, $value, $parameters, $validator) { return $this->app[Captcha::class]->validate($value); }, trans('bone::captcha.incorrect_code')); }
src/resources/lang
when setting the view template, it still takes the data for the template from the vendor
`
<input type="text" id="captcha" name="captcha" autocomplete="off">
</form>`
please fix that fast
Blade template directive @captcha not showing image after updating from v2.1 to v2.2.
First of all thank you for this great and easy to use captcha package.
VERSION
PHP version 7.1.22
Laravel version 5.4
Package version 2.1.0
ISSUE
Captcha validation fails when using $validator->passes() or $validator->fails() inside a FormRequest class. I have a request validation class which always throws the 'Invalid code from the image' error
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class MyRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'captcha' => 'required|captcha',
];
}
public function withValidator($validator)
{
if($validator->passes())
{
//do something
}
}
}
LIKELY CAUSE
Running $validator->passes() or $validator->fails() runs the validation again, but the captcha session is likely cleared in the first validation which causes the validation to fail when run for the second time.
Class bone_captcha does not exist
src/resources/lang
I get the following error when installing this package:
The directive name [] is not valid. Directive names must only contain alphanumeric characters and underscores.
But, I already found a workaround for this.
How to fix this:
composer require bonecms/laravel-captcha
, then you need to uninstall the package first with composer remove bonecms/laravel-captcha
php artisan config:clear
.composer require bonecms/laravel-captcha
php artisan config:cache
src/resources/lang
Laravel ver. 5.4.36
After, following all the necessary steps - the captcha image outputs the alternate text, and inspector shows 'could not load image'.
Could this be a bug? or did I miss out on anything?
Added to provider hence, facade access.
Added config file.
Able to use captcha html output.
But failed to display, captcha image and outputs Alt.
Hello, I'm getting this error Class 'Igoshev\Captcha\Providers\CaptchaServiceProvider' not found
when trying to run php artisan serve
, no matters if I try composer update
or reinstall the module, the error persist. What can it be?
I installed this package and working fine but case sensitive is not checking.
if code expired, just wrong captcha error showed. there is two solution for this problem. first is custom validation error for expired code and second renew automatically code if code expired.
thanks for clean code
Hello,
Is there any way to mock the CAPTCHA in an unit for feature test?
Thanks!
when I'm try to show the captcha in view by @captcha
directive it throws error exception:
ErrorException: imagettftext(): Could not find/open font in file neelain_certificates/vendor/bonecms/laravel-captcha/src/Captcha/Generator/GeneratorWaves.php on line 28
If I comment the font line in config file the error goes away.
'font' => base_path('vendor/bonecms/laravel-captcha/src/resources/fonts/IndiraK.ttf')
@captcha did not working in the html view.....
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.