icekristal / laravel-captcha
Laravel captcha
v2.0.0
2024-03-07 08:27 UTC
Requires
- php: ^8.2
- laravel/framework: ^8|^9|^10|^11
README
install:
composer require icekristal/laravel-captcha
config:
php artisan vendor:publish --provider="Icekristal\LaravelCaptcha\CaptchaServiceProvider" --tag="config"
default fonts:
php artisan vendor:publish --provider="Icekristal\LaravelCaptcha\CaptchaServiceProvider" --tag="fonts"
use:
get all info. Return array keys: image_no_encode, image, secret_key
$arrayInfoCaptcha = \Icekristal\LaravelCaptcha\Facades\IceCaptcha::generateAndGetAllInfo();
set settings
$image = \Icekristal\LaravelCaptcha\Facades\IceCaptcha::setLength(4)->setLevel(2)->generateAndGetAllInfo();
all info settings:
setColorBackground('#000000'); setListColors(['#FFFFFF', '#0000FF', '#FF0000']);
get only no encode image
$captcha = \Icekristal\LaravelCaptcha\Facades\IceCaptcha::generate()->getImageNoEncode();
checking captcha:
$requestData = explode("&&", Crypt::decryptString($this->get('captcha_secret'))); $requestData[0]; //text captcha $requestData[1]; //timestamp captcha