定制 dazza-dev/laravel-captcha-solver 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dazza-dev/laravel-captcha-solver

最新稳定版本:v1.0.0

Composer 安装命令:

composer require dazza-dev/laravel-captcha-solver

包简介

Laravel implementation of anti-captcha.com, capsolver.com and capmonster.cloud

README 文档

README

This package provides a simple and convenient way to solve captchas using different services.

Supported Services

  • anticaptcha - api.anti-captcha.com
  • capmonster - api.capmonster.cloud
  • capsolver - api.capsolver.com

Installation

composer require dazza-dev/laravel-captcha-solver

Configuration

Publish the configuration file:

php artisan vendor:publish --provider="DazzaDev\LaravelCaptchaSolver\CaptchaSolverServiceProvider" --tag=captcha-solver-config

Add environment variables to .env:

CAPTCHA_SOLVER_SERVICE=anticaptcha   # or capmonster, capsolver
CAPTCHA_SOLVER_API_KEY=your-api-key-here

Usage

Using Facade

use DazzaDev\LaravelCaptchaSolver\Facades\CaptchaSolver;

// Optional: set service and API key at runtime
CaptchaSolver::setService('capsolver')->setApiKey('your-api-key-here');

// Get balance
$balance = CaptchaSolver::getBalance();

// Solve reCaptcha V2
$solutionV2 = CaptchaSolver::solveReCaptchaV2('https://site.example', 'site-key-v2');

// Solve reCaptcha V3
$solutionV3 = CaptchaSolver::solveReCaptchaV3('https://site.example', 'site-key-v3');

Dependency Injection

use DazzaDev\LaravelCaptchaSolver\CaptchaSolverManager;

class ExampleController
{
    private CaptchaSolverManager $solver;

    public function __construct(CaptchaSolverManager $solver)
    {
        $this->solver = $solver;
    }

    public function solve(): string
    {
        // Optional: set service and API key at runtime
        $this->solver->setService('anticaptcha')->setApiKey('your-api-key-here');

        return $this->solver->solveReCaptchaV2('https://site.example', 'site-key-v2') ?? '';
    }
}

Notes

  • The provider auto-registers and reads captcha-solver.php config keys.
  • Use the specific tag captcha-solver-config to publish only this package's config.

Contributions

Contributions are welcome. If you find any bugs or have ideas for improvements, please open an issue or send a pull request. Make sure to follow the contribution guidelines.

Author

Laravel Captcha Solver was created by DAZZA.

License

This project is licensed under the MIT License.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-11-29