Download the PHP package shetabit/captcha without Composer

On this page you can find all versions of the php package shetabit/captcha. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package captcha

Laravel Captcha

Latest Version on Packagist Total Downloads on Packagist Tests Code Style Static Analysis Code Coverage

This is a Laravel Package for captcha Integration. It requires PHP 8.4+ (with the gd extension) and supports Laravel 12 and Laravel 13.

This packages works with multiple drivers, and you can create custom drivers if there are not available in the current drivers list (below list).

List of contents

List of available drivers

you can create your own custom driver if not exists in the list , read the Create custom drivers section.

Install

Via Composer

Configure

The service provider and the Captcha alias are registered by Laravel's package discovery, so there is nothing to add to config/app.php (or to bootstrap/providers.php). The old way still works:

then run php artisan vendor:publish to publish config/captcha.php file in your config directory.

In the config file you can set the default driver to use for all your payments. But you can also change the driver at runtime.

Choose what gateway you would like to use in your application. Then make that as default driver so that you don't have to specify that everywhere. But, you can also use multiple gateways in a project.

Then see the configs in the drivers array.

How to use

you have 2 steps to go

Add captcha in forms

In your code, use it like the below:

if you use simple driver, you can change the styles and UI easily, just have a look on resources/views/vendor/captchaSimpleDriver.blade.php

Validation

in order to validate forms wich use captcha, you can use captcha validation role.

The below example shows every thing you need to know about captcha validation:

Create custom drivers:

First you have to add the name of your driver, in the drivers array and also you can specify any config parameters you want.

Now you have to create a Driver Map Class that will be used to pay invoices. In your driver, You just have to extend Shetabit\Captcha\Abstracts\Driver.

Ex. You created a class : App\Packages\CaptchaDriver\MyDriver.

Once you create that class you have to specify it in the captcha.php config file map section.

Note:- You have to make sure that the key of the map array is identical to the key of the drivers array.

Testing

Every pull request and every push to master is checked by GitHub Actions: the test suite runs on PHP 8.4 and 8.5, against Laravel 12 and 13 and against both the lowest and the highest supported dependencies, the coding style is checked with PHP_CodeSniffer, the sources are analysed with PHPStan (level 7, with larastan) and the code coverage of the test suite is measured and has to stay above 90%.

The suite has two parts: tests/Unit covers the manager, the driver, the provider and the helpers on their own, and tests/Feature runs the flow of this readme end to end — a form is shown, its captcha image is fetched over the route of the driver, and the answer is validated when the form comes back.

You can run the same checks locally. With PHP and Composer installed on your machine:

If you would rather not install PHP on your machine, the shipped Dockerfile and Makefile run everything inside a container:

Another PHP version can be used with make test PHP_VERSION=8.5, and a single Laravel version with make test-laravel LARAVEL=12.

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of captcha with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-gd Version *
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/view Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shetabit/captcha contains the following files

Loading the files please wait ...