Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hamog/captcha
Simple captcha solution for laravel 5
https://github.com/hamog/captcha
captcha laravel laravel-5-package laravel-captcha
Last synced: 2 months ago
JSON representation
Simple captcha solution for laravel 5
- Host: GitHub
- URL: https://github.com/hamog/captcha
- Owner: hamog
- Created: 2016-08-04T08:47:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-15T09:13:23.000Z (about 4 years ago)
- Last Synced: 2024-10-14T06:10:01.184Z (3 months ago)
- Topics: captcha, laravel, laravel-5-package, laravel-captcha
- Language: PHP
- Homepage: https://laravel.com/
- Size: 46.9 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# captcha
## Simple Captcha for laravel 6### Installation
Require this package with composer:
```
composer require hamog/captcha
```Find the providers key in config/app.php and register the Captcha Service Provider.
```php
'providers' => [
// ...
Hamog\Captcha\CaptchaServiceProvider::class,
]
```Find the aliases key in config/app.php.
```php
'aliases' => [
// ...
'Captcha' => Hamog\Captcha\Facades\Captcha::class,
]
```### Configuration
To use your own settings, publish config.
```
php artisan vendor:publish --provider="Hamog\Captcha\CaptchaServiceProvider"
```To use your own settings in config/captcha.php, publish config.
```php
return [
'width' => 170,
'height' => 60,
'font_color' => '#1A3EA1', //only hexadecimal
'size' => 22,
'length' => 6,
'sensitive' => false,
];
```### Preview
![captcha-preview](https://github.com/hamog/captcha/blob/master/assets/img/captcha.png)
### Usage
return captcha image:
```php
{!! Captcha::create() !!}//Or
{!! captcha() !!}
```Create html image tag:
```php
{!! Captcha::img() !!}//Or
{!! captcha_img() !!}
```return captcha src:
```php
{!! Captcha::src() !!}//Or
{!! captcha_src() !!}
```### Validation
Using captcha rule:
```php
'captcha' => 'required|captcha',
```Add custom rule message:
```php
'captcha' => 'The :attribute is invalid',
```