Download the PHP package zhylon/captcha-laravel without Composer

On this page you can find all versions of the php package zhylon/captcha-laravel. 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-laravel

Latest Stable Version Tests License

Laravel integration for server-side verification of Zhylon Captcha tokens. Built on top of zhylon/captcha-php.

Requirements

Installation

Publish the config file:

Set your secret key in .env:

Usage

Via the Captcha facade:

Or inject Zhylon\CaptchaPhp\CaptchaClient wherever you need it — it's bound as a singleton in the container.

Self-hosted challenge/verify proxy

If your widget's JS should talk to your own domain instead of captcha.zhylon.net directly, the package can forward the captcha/challenge and captcha/verify calls for you. It reuses the host already configured via verify_url, so no extra config is needed, and upstream failures never surface as an exception — you always get back a status code and JSON body.

Fastest option — built-in routes. Enable them and the package registers GET {prefix}/challenge and POST {prefix}/verify for you, backed by Zhylon\CaptchaLaravel\Http\Controllers\CaptchaProxyController:

By default this exposes GET /captcha/challenge and POST /captcha/verify. Adjust the prefix or middleware via config (see below) — e.g. to put them behind throttle or api.

Manual option — the CaptchaProxy facade. If you want your own route/controller (custom path, extra validation, etc.), call the facade directly:

Or inject Zhylon\CaptchaPhp\CaptchaProxy — it's also bound as a singleton, derived from the same CaptchaClient.

Note: CaptchaProxy::verify() forwards the proof-of-work captcha/verify call (returns a verification_token). It is unrelated to Captcha::verify() / CaptchaClient::verify(), which is the server-side siteverify check performed with your secret key.

Config

Key Env variable Default Description
site_key ZHYLON_CAPTCHA_SITE_KEY — Your Zhylon Captcha site key
secret_key ZHYLON_CAPTCHA_SECRET_KEY — Your Zhylon Captcha secret key
verify_url ZHYLON_CAPTCHA_VERIFY_URL https://captcha.zhylon.net/captcha/siteverify Verification endpoint
timeout ZHYLON_CAPTCHA_TIMEOUT 5 Request timeout in seconds
proxy.enabled ZHYLON_CAPTCHA_PROXY_ENABLED false Registers the built-in challenge/verify routes
proxy.prefix ZHYLON_CAPTCHA_PROXY_PREFIX captcha Route prefix for the built-in proxy routes
proxy.middleware — ['api'] Middleware applied to the built-in proxy routes
proxy.timeout ZHYLON_CAPTCHA_PROXY_TIMEOUT 5 Timeout for the forwarded challenge/verify calls

CaptchaResult

Property Type Description
success bool Whether verification succeeded
reason ?string invalid_token, config_error, or network_error on failure
message ?string Human-readable explanation

Use $result->isTechnicalFailure() to distinguish infrastructure problems (config_error, network_error) from a genuinely invalid token.

Testing

License

The MIT License (MIT). See LICENSE for more information.


All versions of captcha-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
zhylon/captcha-php Version ^1.1
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 zhylon/captcha-laravel contains the following files

Loading the files please wait ...