PHP code example of mohsen / captcha

1. Go to this page and download the library: Download mohsen/captcha library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mohsen / captcha example snippets


'providers' => array(
  ...
  'Mohsen\Captcha\CaptchaServiceProvider',
  ...
),
...
'aliases' => array(
  ...
  'Captcha'		  => 'Mohsen\Captcha\Captcha',
  ...
),

$rules = array(
  'user-captcha' => 'ut::all(), $rules);

if($validator -> fails()) {
  return Redirect::back() -> withErrors($validator);
}

<img src="{{Captcha::getImage($count, $width, $height, $backgroundColor, $quality)}}">