PHP code example of icekristal / laravel-captcha

1. Go to this page and download the library: Download icekristal/laravel-captcha library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

icekristal / laravel-captcha example snippets


composer 

php artisan vendor:publish --provider="Icekristal\LaravelCaptcha\CaptchaServiceProvider" --tag="config"

php artisan vendor:publish --provider="Icekristal\LaravelCaptcha\CaptchaServiceProvider" --tag="fonts"

$arrayInfoCaptcha = \Icekristal\LaravelCaptcha\Facades\IceCaptcha::generateAndGetAllInfo();

$image = \Icekristal\LaravelCaptcha\Facades\IceCaptcha::setLength(4)->setLevel(2)->generateAndGetAllInfo();

setColorBackground('#000000');
setListColors(['#FFFFFF', '#0000FF', '#FF0000']);

$captcha = \Icekristal\LaravelCaptcha\Facades\IceCaptcha::generate()->getImageNoEncode();

$requestData = explode("&&", Crypt::decryptString($this->get('captcha_secret')));
$requestData[0]; //text captcha
$requestData[1]; //timestamp captcha