lexal / laravel-step-validator
Laravel Step validator.
v3.0.0
2026-04-23 21:01 UTC
Requires
- php: >=8.2
- illuminate/contracts: ^11.0 || ^12.0
- illuminate/support: ^11.0 || ^12.0
- lexal/stepped-form: ^4.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0.0
- illuminate/container: ^11.0 || ^12.0
- illuminate/http: ^12.0
- infection/infection: ^0.30.1
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5.62
- roave/security-advisories: dev-latest
- webimpress/coding-standard: ^1.4
Suggests
- illuminate/validation: Required to use step data validation on Before Handle Step event (^11.0 || ^12.0).
This package is auto-updated.
Last update: 2026-04-23 21:03:39 UTC
README
This package validates step data on the BeforeHandleStep event from Stepped Form.
Requirements
PHP: >=8.2
Laravel: ^11.0 || ^12.0
Installation
Via Composer
composer require lexal/laravel-step-validator
Usage
Implement ValidatableStepInterface on your step and the the listener will validate step data before the step is handled.
The validator passes RulesDefinition data directly to Laravel's validator factory method.
use Lexal\LaravelStepValidator\RulesDefinition; use Lexal\LaravelStepValidator\Steps\ValidatableStepInterface; use Lexal\SteppedForm\Steps\RenderStepInterface; final class CustomerStep implements RenderStepInterface, ValidatableStepInterface { public function getRulesDefinition(mixed $entity): RulesDefinition { return new RulesDefinition( /* rules */, /* messages (default - empty array) */, /* custom attributes (default - empty array) */, ); } }
License
Laravel Step Validator is licensed under the MIT License. See LICENSE for the full license text.