riskivy / yii2-rest-api-captcha
The captcha image generator for restful api
Installs: 2 240
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 0
Forks: 2
Open Issues: 0
Requires
- php: >=7.1
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-01-08 22:43:06 UTC
README
Simple captcha image generator for restful api 22
Installation
Recommended installation via composer:
composer require riskivy/yii2-rest-api-captcha
Usage
Generate captcha code (image/png;base64):
(new CaptchaHelper())->generateImage();
Use in HTML:
<img src="<?= (new CaptchaHelper())->generateImage() ?>" />
Verify POST method captcha code:
(new CaptchaHelper())->verify(\Yii::$app->request->post('code'));