Skip to content

Laravel integration of Anti-captcha.com API using official anti-captcha php library

License

Notifications You must be signed in to change notification settings

vovarpd/laravel-anticaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-anticaptcha

Latest Stable Version Total Downloads License Scrutinizer Code Quality Build Status

This Laravel package based on:

https://github.com/AdminAnticaptcha/anticaptcha-php

Installation

Composer

Run the command:

$ composer require vovarpd/laravel-anticaptcha

Or

Add laravel-anticaptcha in your composer.json or create a new composer.json:

{
    "require": {
        "vovarpd/laravel-anticaptcha": "^0.1"
    }
}

Now tell composer to download the library by running the command:

$ php composer.phar install

Composer will generate the autoloader file automatically. So you only have to include this. Typically its located in the vendor dir and its called autoload.php

Then publish config file by running the command:

$ php artisan vendor:publish --tag=anticaptcha

Basic Usage:

Set API key in config/anticaptcha.php or .env file.

<?php

return [
	'key'=>env('ANTICAPTCHA_API_KEY','')
];

Dependency Injection example.

use LaravelAnticaptcha\Anticaptcha\Exceptions\AnticaptchaException;
use LaravelAnticaptcha\Anticaptcha\NoCaptchaProxyless;

public function handle( NoCaptchaProxyless $no_captcha_proxyless ) {
    $no_captcha_proxyless->setVerboseMode(false);
    $no_captcha_proxyless->setWebsiteURL( 'https://targetdomain.com' );
    $no_captcha_proxyless->setWebsiteKey( 'recaptcha_site_key' );
    $no_captcha_proxyless->createTask();
    $taskId = $no_captcha_proxyless->getTaskId();
    $no_captcha_proxyless->waitForResult();
    dump($no_captcha_proxyless->getTaskSolution());
}

About

Laravel integration of Anti-captcha.com API using official anti-captcha php library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages