PHPackages                             tao/laravel-captcha - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. tao/laravel-captcha

ActiveLibrary

tao/laravel-captcha
===================

2183↓100%PHP

Since Oct 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Partoo/laravel-captcha)[ Packagist](https://packagist.org/packages/tao/laravel-captcha)[ RSS](/packages/tao-laravel-captcha/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Captcha for Laravel
===================

[](#captcha-for-laravel)

[![example1](example/p1.png)](example/p1.png)[![example1](example/p2.png)](example/p2.png)[![example1](example/p3.png)](example/p3.png)[![example1](example/p4.png)](example/p4.png)

Description
-----------

[](#description)

Easy to expand and supports multi-language expansion. Reference from [Igoshev/laravel-captcha](https://github.com/igoshev/laravel-captcha/)

Getting Started
---------------

[](#getting-started)

### Dependencies

[](#dependencies)

- ^php7.3|^php8.0
- gd-ext

### Installing

[](#installing)

```
composer require tao/laravel-captcha
```

Usage
-----

[](#usage)

- Get the captcha data

```
axios
    .get('your_domain/api/v1/captcha/image')
    .then(response => (this.captcha = response.data))
```

You will get the result like:

```
{
    "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAyCAIAAAB6RmagAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAF/0lEQVR4nO2bW1BbRRjH9yQhgQQC4X4pVtAUaCktUAoq1o5aLx3qjIoy2DJtpx37gPaho06dPthxHF9wrA/4oMPYB2WkM9hR2+lY2hGL6Bhkyq1TkFDCRW5pIFxyg9x8ODSenJMTkpOzmxO6v6ec3c1+m7P/832bb/cQq6YxgMH4QhTuAWCECxYHhhUsDgwrWBwYVrA4MKxgcWBYweLAsILFgWEFiwPDChYHhhUsDgwrEnhdO1zugQWLdsk2b3OY7M7kaElJimJ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GmIT2z/JkM5ZWX8yQiQT9qJa39Q4s2z2VP9c7i1gE/K4Ptqpju13eiGh0iYHmOht5pn8ooTIy5dEAtcGUAAG5XF9FK/IeegoRNePAHiudoGTGc+G2UGaizFFG3XtmRqZDybpF3GnqnP+r+l/zs02G8fWv0O62BWrL54gv/nqNjevlUh46pjHip+McX8yJCGQCAfRlK6n+ZeKlY91ZxtGR9E9vicP40tkBt335oO7eEbFBZcw+Rmj6vuam1M5b3USLi0vPqHYly3s0FzoY5A+qklqfF5rf0TjxIbS2tOS8MzHxYvL5Z/3nfzIr9/6Nu2QppeVost4RsKDkb2PAfVoLN2wjNG/OYd7Kc3LuhULiZ2zwZ0sjCc99NdmdBSx8tfUcAQHvSVTLxYM1un6dSaBMv5D02n2BxsBIbJf60PPtUh9cpQGYM+KQsm+28kp/nO0ShBBUiORM2cQgtmvikbluKRm/6Zug+W4NjeSnH87nkeUPZMUYGCnH4j7VCuyM0GitzEmUSn8dd39uV8XFZqHleGCeV+ALFMUH/PlAId2FDegzmxjuzGr1pyryWIZc+kRb7TmF6cTLEt/eEIBR0Z0gxnAmXl8XiiCQQuxMsjkgFgVCwODYDkOIOFsemgl93gsWxaQldKFgcDwXchILF8dAR+KshWBwYVoS48RYRu5fU9/Y4f13gYM+BYeU/JAxuGwa14rYAAAAASUVORK5CYII=",
    "validation": "f9cc27ee094dbb5024da2e9a103b3642"
}
```

- Validate the captcha

```
axios
  .post('your_domain/api/v1/captcha/image',[post_data])
  .then(response => (this.validation = response.data))
```

The response like:

```
{
    "message": "The captcha code input valid, please try again",
    "status": 403
}
```

Using the config file you can change the router:

```
    'router_api' => '/api/v1/captcha/image',
```

Configuration
-------------

[](#configuration)

The config file contains many available parameters, all of which are detailed by comment.

```
    php artisan vendor:publish --tag=captcha
```

```
