2017 © Pedro Peláez
 

library captcha

Captcha

image

zablose/captcha

Captcha

  • Friday, April 13, 2018
  • by zablose
  • Repository
  • 2 Watchers
  • 3 Stars
  • 419 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 7 Versions
  • 11 % Grown

The README.md

, (*1)

Captcha

Simple captcha with optional goodies for Laravel., (*2)

Installation

composer require zablose/captcha

Usage with Laravel

New Route & Captcha Types

Check new route is working, by visiting /captcha or /captcha/{type}., (*3)

Captcha Type Dev Link
default /captcha/default
small /captcha/small
invert /captcha/invert
sharpness /captcha/sharpness
blur /captcha/blur
contrast /captcha/contrast
no-angle /captcha/no-angle
bg-color /captcha/bg-color

Look at the config file for more details., (*4)

Login Form

If standard auth is in use, add captcha to your login form like in the login.blade.php template., (*5)

Validation

If standard auth is in use, overwrite method validateLogin like in LoginController class., (*6)

Basic Usage

In case you are not a happy Laravel user, you may still use this package., (*7)

Create captcha, add details to the session and output the image., (*8)

A code may look like:, (*9)

<?php

require __DIR__ . '/../vendor/autoload.php';

use Zablose\Captcha\Captcha;
use Zablose\Captcha\Config;
use Zablose\Captcha\Image;

$captcha = new Captcha(
    new Image(
        (new Config())->update(['invert' => true, 'width' => 220])
    )
);

$data = [
    'captcha' => [
        'sensitive' => $captcha->isSensitive(),
        'hash' => $captcha->hash(),
    ],
];

// Add $data to the session.

echo $captcha->toPng();

To check captcha use:, (*10)

<?php

    use Zablose\Captcha\Captcha;

    // ...

    Captcha::verify('captcha', 'hash');

Feel the joy and happiness!, (*11)

Development

Check submodule readme for more details about development environment used., (*12)

Hosts

Append to /etc/hosts., (*13)

127.0.0.26       captcha.zdev

Quick Start

$ git clone -b 'dev' --single-branch --depth 1 https://github.com/zablose/captcha.git captcha
$ cd captcha
$ git submodule update --init

# Copy env file, then ammend it to your needs.
$ cp .env.example .env

$ docker compose up -d

# To "enter" container, using Bash shell.
$ docker exec -u debian -it captcha-php-fpm bash

(captcha-php-fpm)$ phpunit

The Versions

13/04 2018

dev-master

9999999-dev

Captcha

  Sources   Download

MIT

The Requires

  • php ~7.1
  • ext-gd *

 

The Development Requires

by Sergejs Zablockis

laravel php security bot captcha laravel5 spam

13/04 2018

2.0

2.0.0.0

Captcha

  Sources   Download

MIT

The Requires

  • php ~7.1
  • ext-gd *

 

The Development Requires

by Sergejs Zablockis

laravel php security bot captcha laravel5 spam

13/04 2018

dev-dev

dev-dev

Captcha

  Sources   Download

MIT

The Requires

  • php ~7.1
  • ext-gd *

 

The Development Requires

by Sergejs Zablockis

laravel php security bot captcha laravel5 spam

02/11 2017

1.0.2

1.0.2.0

Captcha for PHP ~7.1

  Sources   Download

MIT

The Requires

 

by Sergejs Zablockis

laravel captcha

02/11 2017

1.1.0

1.1.0.0

Captcha for PHP ~7.1

  Sources   Download

MIT

The Requires

 

by Sergejs Zablockis

laravel captcha

19/10 2017

1.0.1

1.0.1.0

Captcha for PHP ~7.1

  Sources   Download

MIT

The Requires

 

by Sergejs Zablockis

laravel captcha

11/09 2017

1.0.0

1.0.0.0

Captcha for Laravel 5.5

  Sources   Download

MIT

The Requires

 

by Sergejs Zablockis

laravel captcha