PHP code example of cuoma / captcha

1. Go to this page and download the library: Download cuoma/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/ */

    

cuoma / captcha example snippets


    'providers' => array(
        // ...
        'cuoma\Captcha\CaptchaServiceProvider',
    )

    'aliases' => array(
        // ...
        'Captcha' => 'cuoma\Captcha\Facades\Captcha',
    )


    // [your site path]/app/routes.php

    Route::any('/captcha-test', function()
    {

        if (Request::getMethod() == 'POST')
        {
            $rules =  array('captcha' => array(' }
            else
            {
                echo '<p style="color: #00ff30;">Matched :)</p>';
            }
        }

        $content = Form::open(array(URL::to(Request::segment(1))));
        $content .= '<p>' . HTML::image(Captcha::img(), 'Captcha image') . '</p>';
        $content .= '<p>' . Form::text('captcha') . '</p>';
        $content .= '<p>' . Form::submit('Check') . '</p>';
        $content .= '<p>' . Form::close() . '</p>';
        return $content;

    });
$ php artisan config:publish cuoma/captcha