yhbyun/laravel-securimage

Laravel 5 Securimage helper
1,081 3
Install
composer require yhbyun/laravel-securimage
Latest Version:v0.2.4
PHP:>=5.5.0
Laravel:5 – 8
License:MIT
Last Updated:May 11, 2021
Links: GitHub  ·  Packagist
Maintainer: yhbyun

Laravel 5 Securimage helper

Build Status

A simple laravel 5 wrapper package for Securimage.

preview

Installation

Add the package to your composer.json by running:

composer require yhbyun/laravel-securimage

When it's installed, add it to the providers list in config/app.php

Yhbyun\Securimage\SecurimageServiceProvider::class,

Publish assets to your public folder

$ php artisan vendor:publish --provider="Yhbyun\Securimage\SecurimageServiceProvider"

Configuration

config/securimage.php

return [
    'length' => env('SECURIMAGE_LENGTH', 6),
    'width'  => env('SECURIMAGE_WIDTH', 215),
    'height'  => env('SECURIMAGE_HEIGHT', 80),
    'perturbation' => env('SECURIMAGE_PERTURBATION', .85),
    'case_sensitive' => env('SECURIMAGE_CASE_SENSITIVE', false),
    'num_lines' => env('SECURIMAGE_NUM_LINES', 0),
    'charset' => env('SECURIMAGE_CHARSET', 'ABCDEFGHKLMNPRSTUVWYZabcdefghklmnprstuvwyz23456789'),
    'signature' => env('SECURIMAGE_SIGNATURE', 'ecplaza'),
    'show_text_input' => env('SECURIMAGE_SHOW_TEXT_INPUT', false),
];

Example Usage

app/Http/routes.php

Route::any('captcha-test', function()
{
    if (Request::getMethod() == 'POST')
    {
        $rules = ['captcha' => 'required|captcha'];
        $validator = Validator::make(Input::all(), $rules);
        if ($validator->fails())
        {
            echo '<p style="color: #ff0000;">Incorrect!</p>';
        }
        else
        {
            echo '<p style="color: #00ff30;">Matched :)</p>';
        }
    }

    $form = '<form method="post" action="captcha-test">';
    $form .= '<input type="hidden" name="_token" value="' . csrf_token() . '">';
    $form .= '<p>' . captcha_img() . '</p>';
    $form .= '<p><button type="submit" name="check">Check</button></p>';
    $form .= '</form>';
    return $form;
});

Testing

$ phpunit --stderr

Related Packages

captcha-com/laravel-captcha

Laravel Captcha Package -- BotDetect PHP Captcha generator integration for the L...

211,632 39
bonecms/laravel-captcha

Captcha integration for the Laravel 5

146,949 76
metrakit/visualcaptcha-laravel

Laravel library for visualCaptcha. VisualCaptcha is created by EmotionLoop

1,898 8
anhskohbo/no-captcha

No CAPTCHA reCAPTCHA For Laravel.

9,813,313 1,847
buzz/laravel-google-captcha

Google captcha for Laravel

1,184,696 208

Version History

Version Released PHP Laravel License
v0.2.4 >=5.5.0 ~5.0|~6.0|~7.0|~8.0 MIT
v0.2.3 >=5.5.0 ~5.0|~6.0|~7.0|~8.0 MIT
v0.2.2 >=5.5.0 ~5.0|~6.0|~7.0|~8.0 MIT
v0.2.1 >=5.5.0 ~5.0|~6.0|~7.0|~8.0 MIT
v0.2.0 >=5.5.0 ~5.0|~6.0|~7.0|~8.0 MIT