andreaspabst / lumen-request-validation by andreaspabst

Adds the Laravel ability to separate validations from the controller
258
1
2
Package Data
Maintainer Username: andreaspabst
Maintainer Contact: management@andreaspabst.com (Andreas Pabst)
Package Create Date: 2019-03-17
Package Last Update: 2019-03-17
Language: PHP
License: MIT
Last Refreshed: 2024-11-15 15:12:24
Package Statistics
Total Downloads: 258
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Lumen Request Validation

Adds the well known Laravel ability to separate validations from the controller.

Installation

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

How to call

php artisan make:request RequestName

The new class can be found under app/Http/Requests folder.

Example usage

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) {
	    // ...
    }
    //...
}

Other stuff...

Have Fun Using!

Security

If you discover any security related issues, please email management@andreaspabst.com instead of using the issue tracker.

Postcardware

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.

Credits

Andreas Pabst

License

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