carpcai/swoft-captcha

A captcha for swoft framework

v1.1 2018-12-04 16:07 UTC

This package is auto-updated.

Last update: 2022-11-05 17:03:55 UTC


README

A Captcha Library that Imitation from thinkphp Captcha developed for swoft.

Usage

Build a captcha in controller

/**
 * @RequestMapping("/")
 */
public function index(Response $response): Response
{
    $captcha = new Captcha();

    return $captcha->entry($response);
}

Sample image

image

Check if the captcha code is correct

$captcha = new Captcha();

return $captcha->check($code);