Download the PHP package fridzema/laravel-validation-plus without Composer

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

Laravel Validation Plus

CI Coverage PHPStan Latest Version on Packagist PHP Version

Non-blocking validation warnings for Laravel. Add advisory messages to your form requests that inform users without preventing submission.

How It Works

Warnings are advisory messages that don't block form submission. Unlike validation errors (red, HTTP 422), warnings (amber) let the request through while informing users about potential issues.

Requirements

Package PHP Laravel
1.x ^8.3 11.x, 12.x

Installation

Optionally publish the config:

Add the middleware to routes that need warnings:

Usage

FormRequest

Add the HasWarningRules trait and define warningRules():

Warning rules are evaluated after standard validation passes. If validation fails, warnings are never checked.

Method Purpose Default
warningRules() Rules that trigger warnings []
warningMessages() Custom warning messages []
warningAttributes() Custom field display names (:attribute substitution) []

Manual Usage

Use WarningValidator directly in controllers:

Blade

A $warnings variable (a WarningBag instance) is automatically shared with all views:

Or use the included component:

Or use the @warning directive (mirrors @error):

API Responses

When the ShareWarnings middleware is active and warnings exist, API responses automatically get:

Precognition (Real-Time Validation)

The package integrates with Laravel Precognition for real-time per-field warnings as users type.

Real-time warnings Real-time errors

Add the HandlePrecognitiveRequests middleware to your route:

Warning rules are automatically filtered by the Precognition-Validate-Only header, so only the field being validated is checked.

Warnings are returned in the X-Validation-Warnings-Data response header as JSON:

Frontend Integration

Warnings travel in two ways depending on your setup:

Request type Warnings location
Standard API (Accept: application/json) JSON body under warnings key
Precognition (real-time, Precognition: true) X-Validation-Warnings-Data header as JSON

Axios

An interceptor that surfaces warnings on every response:

Vue 3

React

Alpine.js

Global Warnings

For advisory messages not tied to a specific field:

Access them in Blade with the reserved __global__ key:

Helper Function

Testing

Test macros are registered automatically:

Configuration

Warnings vs Errors

Errors Warnings
Block request Yes No
Cause validation failure Yes No
HTTP status 422 200 (original)
Blade variable $errors $warnings
Session flash Automatic Via middleware
API response Standard Laravel Header + JSON key

Octane Compatibility

WarningBag uses a scoped binding and is reset between requests automatically by Laravel Octane. No extra configuration needed.

Changelog

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

License

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


All versions of laravel-validation-plus with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.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 fridzema/laravel-validation-plus contains the following files

Loading the files please wait ...