nivseb / strict-request
Strict form request allows you to build with more restrictive strict validation.
Requires
- php: ^8.2
- illuminate/contracts: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
Requires (Dev)
- ext-pdo: *
- ext-redis: *
- friendsofphp/php-cs-fixer: ^3.64
- guzzlehttp/guzzle: ^7.8
- kubawerlos/php-cs-fixer-custom-fixers: ^3.22
- mockery/mockery: ^1.6
- orchestra/pest-plugin-testbench: ^3.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-faker: ^3.0
- phpstan/phpstan: ^1.12
- rector/rector: ^1.2
This package is auto-updated.
Last update: 2025-06-07 22:50:20 UTC
README
This package provide a extended request class, based on the laravel FormRequest
. This extended request class allow you
to write more restricted validation rules. By default, the original form request combine all input sources to validate
all
data based one rule set.
If you want to define on wich way the client should send the data to your application, this package is the solution.
The StrictFormRequest
define rules for the different input sources and validate only the data from that input source
with that
validation rule set.
Example
In some cases it's important for your application that some data are only include as body and not as query parameter.
In that case you can define in your request the bodyRules
method. That will ensure, in combination with your rules,
that the data are present in the body and not in the query parameter.
Installation
- To install PHP Mock Server Connector you can easily use composer.
composer require nivseb/strict-request
- Build your request by extending from
\Nivseb\StrictRequest\Http\StrictFormRequest
- Write your validation by adding rules for header, body and/or query