Download the PHP package xaniashield/laravel without Composer

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

Xania Shield for Laravel

Privacy-first, EU-hosted spam protection for Laravel forms. This is the official Laravel client for the Xania Shield API — block bots and spam across your forms without CAPTCHAs, without Google, and without sending visitor data to third-party AI services.

Requirements

Installation

The service provider and Shield facade are auto-discovered — no manual registration needed.

Publish the config file (optional):

Add your credentials to .env:

Usage

Basic — analyze a submission

Inject the client (or use the Shield facade) in any controller:

With the facade

The verdict object

Honeypot

A honeypot is a hidden field that bots fill and humans never touch. Add one to your form:

The client reads the configured honeypot field automatically (default website_url). To use a different field name, pass it explicitly:

Timing signal (optional)

The timing signal measures how long a form took to fill — bots submit near-instantly. It requires SHIELD_TIMING_SECRET to be set.

Render a signed timestamp field in your form:

The client verifies and includes the elapsed time automatically on the next checkRequest().

Fail-open vs fail-closed

By default (SHIELD_FAIL_OPEN=true), if the API is unreachable, times out, or errors, submissions are allowed — protection never breaks your forms. Set SHIELD_FAIL_OPEN=false to block on uncertainty instead (stricter, but a Shield outage would block submissions).

Health check

Configuration reference

All values are read from config/shield.php (env-driven):

Key Env Default Purpose
api_key SHIELD_API_KEY '' Your site API key
base_url SHIELD_BASE_URL https://xaniashield.com/v1 API base URL
timeout SHIELD_TIMEOUT 5 Request timeout (seconds)
fail_open SHIELD_FAIL_OPEN true Allow on API failure
timing_secret SHIELD_TIMING_SECRET '' HMAC secret for timing
challenge_threshold SHIELD_CHALLENGE_THRESHOLD 40 Score for challenge
block_threshold SHIELD_BLOCK_THRESHOLD 70 Score for block
honeypot_field SHIELD_HONEYPOT_FIELD website_url Honeypot field name
timing_field SHIELD_TIMING_FIELD xsh_tf Timing field name

Integration recipes

Forms differ across projects — field names, honeypots, Livewire vs controllers. Pick the entry point that fits. All of them ultimately call the same engine; choose by how much control you want.

1. Middleware (simplest — protect a whole route)

For standard forms with email / message / name / subject fields:

On a block verdict it aborts with HTTP 422 before reaching your controller. No controller changes needed. For non-standard field names, use one of the options below instead.

2. Validation rule (idiomatic — fits existing validation)

Attach the rule to one field only (usually email) — it analyses the whole request, not just that field. A block fails validation with a generic message you can customise: new ShieldRule('contact', 'Your message looks like spam.').

3. Controller call (most control — custom field mapping)

When your fields are non-standard, map them explicitly:

4. Livewire component

Livewire has no per-submit HTTP request for the form fields, so pass values from the component state and add visitor_ip explicitly.

5. Form Request class

6. API endpoint (JSON)

Honeypot & timing in Blade

Add a honeypot (and optionally a timing field) to any form with directives:

@shieldHoneypot renders a hidden field named after config('shield.honeypot_field'). The client reads it back automatically.

License

MIT — see LICENSE.


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^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 xaniashield/laravel contains the following files

Loading the files please wait ...