sanchescom/lumen-form-request

0.1.0 2019-07-17 12:51 UTC

This package is auto-updated.

Last update: 2024-10-26 22:47:24 UTC


README

Laravel Form Request for Lumen framework

Installing

Require this package, with Composer, in the root directory of your project.

composer require sanchescom/lumen-form-request

After updating composer add the following lines to register provider in bootstrap/app.php

$app->register(Sanchescom\Foundation\Providers\FormRequestServiceProvider::class);

Usage

<?php

namespace App\Http\Requests;

use Sanchescom\Foundation\Http\FormRequest;

class StoreRequest extends FormRequest
{
	public function authorize()
	{
		return true;
	}

	public function rules()
	{
            return [
                'name' => 'required|max:255',
                'last_name' => 'required|max:255',
                'email' => 'required|unique:users|email|max:100',
                'password' => 'required|max:45',
            ];
	}
}

Laravel Form Request documentation