Adds the Laravel ability to separate validations from the controller
andreaspabst/lumen-request-validation is a Laravel package for adds the laravel ability to separate validations from the controller.
It currently has 1 GitHub stars and 266 downloads on Packagist (latest version 1.4.0).
Install it with composer require andreaspabst/lumen-request-validation.
Discover more Laravel packages by andreaspabst
or browse all Laravel packages to compare alternatives.
Last updated
Adds the well known Laravel ability to separate validations from the controller.
First use composer to install the package..
composer require andreaspabst/lumen-request-validation
Next register the packages service provider in your bootstrap/app.php
$app->register(AndreasPabst\RequestValidation\RequestServiceProvider::class);
Then you are able to create requests with artisan comparable to laravel
php artisan make:request RequestName
The new class can be found under app/Http/Requests folder.
Use your Request class in a controller via method injection
<?php
use App\Http\Requests\ExampleRequest;
class ExampleController extends Controller
{
public function index(ExampleRequest $request) {
// ...
}
//...
}
Have Fun Using!
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
You're free to use this package, but if it makes it to your product we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is provided on Andreas Pabst.com
We publish all received postcards on our website.
Andreas Pabst
The MIT License (MIT). Please see License File for more information.