pokeguys/luosimao-captcha

Luosimao Validator for Laravel 5

1.0.0 2017-10-23 05:28 UTC

README

A Luosimao Validator for Laravel 5.

Installation

Add the following line to the require section of composer.json:

"require": {
  "pokeguys/laravel-luosimao-captcha": "dev-master"
}

Setup

  1. In /config/app.php, add the following to providers:
'providers' => [
    // Other Service Providers

    Pokeguys\Luosimao\LuosimaoServiceProvider::class,
],

and the following to aliases:

'aliases' => [
  // Other Aliases

  'Luosimao' => Pokeguys\Luosimao\Facades\Luosimao::class,
],
  1. Run php artisan vendor:publish --provider="Pokeguys\Luosimao\LuosimaoServiceProvider".
  2. In /config/luosimao.php, enter your Luosimao public and private keys.
  3. The package ships with a default validation message, but if you want to customize it, add the following line into resources/lang/[lang]/validation.php:
[
  // Other validation message

  'luosimao' => 'The :attribute field is not correct.',
]

Usage

In your validation rules, add the following:

$rules = [
    // ...
    'luosimao' => 'required|luosimao',
];

It's also recommended to add required when validating.