PHP code example of jahanzaibbahadur / laravel-captcha

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

    

jahanzaibbahadur / laravel-captcha example snippets


    'providers' => [
        // ...
        'Latrell\Captcha\CaptchaServiceProvider',
    ]

    'aliases' => [
        // ...
        'Captcha' => 'Latrell\Captcha\Facades\Captcha',
    ]

return [
	// ...
	'captcha' => '图片验证码不正确。',
];


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

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

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

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

    });