mawuekom/laravel-form-request

Laravel Form Request adaptation for Lumen Framework

v1.1.0 2022-04-21 14:11 UTC

This package is auto-updated.

Last update: 2024-12-21 20:14:19 UTC


README

This package is a Laravel Form Request adaptation for Lumen Framework. You can use it in Laravel also but, it's not necessary.

Installation

You can install the package via composer:

composer require mawuekom/laravel-form-request

Make some configs

  • Add the service provider in bootstrap/app.php
$app->register(Mawuekom\FormRequest\FormRequestServiceProvider::class);

Next step is create your FormRequest and extends from Mawuekom/FormRequest/Http/FormRequest

Usage

<?php

namespace App\Http\Requests;

use Mawuekom\FormRequest\Http\FormRequest;

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

	public function rules()
	{
		return [
			'name' => 'required|string',
			'email' => 'required|string|email',
		];
	}
}

License

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