Download the PHP package preverus/preverus-laravel without Composer

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

Preverus Laravel

Laravel integration for Preverus hosted-script form protection and backend fraud decisions.

Website: https://preverus.com
Documentation: https://preverus.com/docs

This package is designed for Laravel, PHP, and server-rendered applications that do not use the JavaScript npm SDK. It pairs the hosted Preverus browser script with trusted Laravel backend enforcement.

Install

Add keys to .env:

Use two keys in production:

Never put your server key in Blade, JavaScript, or public config.

Quick Start

Add the hosted script to your main layout:

Protect a server-rendered form:

Before submit, the hosted script attaches hidden fields:

Evaluate risk in your controller:

No try/catch is required for normal use. If Preverus is unavailable, the package returns a fallback DecisionResult based on your configured failure mode.

Failure Modes

Failure mode is optional. If you do not configure it, the package defaults to open so your Laravel app keeps working if Preverus is temporarily unreachable.

Optional .env value:

Supported modes:

Recommended defaults:

You can override per call:

Fallback decisions are still valid objects:

Retries And Timeouts

Defaults are short so your Laravel request does not hang:

The underlying PHP client retries transient network failures and retryable HTTP statuses:

It does not retry validation or auth failures like 400, 401, 403, or 422.

The Laravel wrapper automatically sends X-Idempotency-Key for decision and event POSTs.

Circuit Breaker

The package includes a simple cache-backed circuit breaker. If repeated Preverus calls fail, Laravel temporarily stops making outbound calls and immediately returns fallback decisions.

This protects merchant apps from slow request chains during an outage.

What evaluate() Sends

Preverus::evaluate($request, [...]) automatically extracts:

It sends preverus_visitor_id as X-Visitor-ID when available.

It sends preverus_risk_session_token as risk_session_token when available. This is preferred because it links the trusted backend action to the stored browser session collected moments earlier.

Sensitive Actions

Use synchronous decisions for actions where your app needs an immediate allow/review/block answer:

Good event names include:

Middleware

For simple routes, you can use middleware:

The first argument is the event_type. The second optional argument is a route name for review outcomes.

Controller-level usage is still recommended for complex flows because every application handles step-up and manual review differently.

Queue Non-Blocking Events

Use queued events for telemetry that does not need to block the user:

Queue config:

Queued event jobs retry with backoff:

Lookups

Visitor lookup:

Metadata lookup:

Use lookups for investigations and added context. Do not use lookups as the only enforcement decision for sensitive actions; call evaluate() for final allow/review/block guidance.

Webhook Verification

Webhook delivery is at-least-once. Always dedupe by X-Fraud-Webhook-Id or payload id.

For a complete verify-parse-dispatch flow:

The package does not own your idempotency table because every Laravel app stores operational events differently.

Strict Exceptions

If you want exceptions instead of fallback decisions:

Most production apps should use evaluate() so a temporary external failure does not crash the customer flow.

Full Config

Production Checklist


All versions of preverus-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
preverus/preverus-php Version ^0.1
illuminate/cache Version ^10.0|^11.0|^12.0
illuminate/config Version ^10.0|^11.0|^12.0
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
psr/log Version ^1.1|^2.0|^3.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 preverus/preverus-laravel contains the following files

Loading the files please wait ...