2017 © Pedro Peláez
 

library solvemedia-captcha

Solve Media Captcha For Laravel.

image

rubensrocha/solvemedia-captcha

Solve Media Captcha For Laravel.

  • Friday, April 13, 2018
  • by rubensrocha
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Solve Media Captcha for Laravel

Package integration of SolveMedia captcha for Laravel, (*1)

Installation

composer require rubensrocha/solvemedia-captcha

Laravel 5 - 6

Setup

NOTE This package supports the auto-discovery feature of Laravel 5.5, So skip these Setup instructions if you're using Laravel 5.5 and above., (*2)

In app/config/app.php add the following :, (*3)

1- The ServiceProvider to the providers array :, (*4)

Rubensrocha\SolveMediaCaptcha\SolveMediaCaptchaServiceProvider::class,

2- The class alias to the aliases array :, (*5)

'SolveMediaCaptcha' => Rubensrocha\SolveMediaCaptcha\Facades\SolveMediaCaptcha::class,

3- Publish the config file, (*6)

php artisan vendor:publish --provider="Rubensrocha\SolveMediaCaptcha\SolveMediaCaptchaServiceProvider"

Configuration

Add these fields in .env file :, (*7)

SOLVEMEDIA_CKEY="your_public_key"
SOLVEMEDIA_VKEY="your_verification_key"
SOLVEMEDIA_HKEY="your_authentication_key"
SOLVEMEDIA_SSL=TRUE

You can obtain them from here, (*8)

Display CAPTCHA

{!! SolveMediaCaptcha::display() !!}

Validation

Add 'adcopy_response' => 'required|solvemediacaptcha' to rules array :, (*9)

$validate = Validator::make(Input::all(), [
    'adcopy_response' => 'required|solvemediacaptcha'
]);

Custom Validation Message

Add the following values to the custom array in the validation language file :, (*10)

'custom' => [
    'adcopy_response' => [
        'required' => 'Please verify that you are not a robot.',
        'solvemediacaptcha' => 'Captcha error! try again later or contact site admin.',
    ],
],

Then check for captcha errors in the Form :, (*11)

@if ($errors->has('adcopy_response'))
    <span class="help-block">
        <strong>{{ $errors->first('adcopy_response') }}</strong>
    </span>
@endif

Packages used as reference for creating this package.

anhskohbo/no-captcha => https://github.com/anhskohbo/no-captcha, (*12)

traderinteractive/solvemedia-client-php => https://github.com/traderinteractive/solvemedia-client-php, (*13)

Contribute

https://github.com/rubensrocha/solvemedia-captcha/pulls, (*14)

The Versions

13/04 2018

dev-master

9999999-dev

Solve Media Captcha For Laravel.

  Sources   Download

MIT

The Requires

  • php >=5.5.5

 

by Avatar rubensrocha

laravel captcha laravel5 solvemedia-captcha solve media