PHP code example of insign / laravel-decaptcha

1. Go to this page and download the library: Download insign/laravel-decaptcha 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/ */

    

insign / laravel-decaptcha example snippets


'providers' => [
    // your others classes here...
    
    insign\LaravelDecaptcha\LaravelDecaptchaServiceProvider::class,
    
],

	$app->register(insign\LaravelDecaptcha\LaravelDecaptchaServiceProvider::class);

'aliases' => array(
    // your others classes here...

	'Decaptcha' => insign\LaravelDecaptcha\LaravelDecaptchaFacade::class,
),

$path = 'path/insideto/captcha.png';
if (Decaptcha::run($path)) {
    $solved = Decaptcha::result();
} else {
    throw new \Exception(Decaptcha::error());
}

   $path = 'https://vk.com/captcha.php?sid=698254154192&s=1';
   if (Decaptcha::run($path)) {
       $solved = Decaptcha::result();
   } else {
       throw new \Exception(Decaptcha::error());
   }
shell
php artisan vendor:publish --provider="insign\LaravelDecaptcha\LaravelDecaptchaServiceProvider"