seytar / lumen-form-request by seytar
forked from deusmar/lumen-form-request

Laravel Form Request adaptation for Lumen framework.
112
0
0
Package Data
Maintainer Username: seytar
Package Create Date: 2021-07-02
Package Last Update: 2021-07-02
Language: PHP
License: MIT
Last Refreshed: 2024-11-17 03:08:35
Package Statistics
Total Downloads: 112
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 0
Total Forks: 0
Total Open Issues: 0

lumen-form-request

Laravel Form Request adaptation for Lumen framework

How to install

Lumen 5.6 +

composer require seytar/lumen-form-request
  • Add the service provider in bootstrap/app.php
$app->register(Urameshibr\Providers\FormRequestServiceProvider::class);

Next step is create your FormRequest and extends from Urameshibr/Requests/FormRequest

Example

<?php

namespace App\Http\Requests;

use Urameshibr\Requests\FormRequest;

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

	public function rules()
	{
		return [
			'mac_address' => 'required|unique:devices,mac_address'
		];
	}
}
  • Link for Laravel Form Request documentation

https://laravel.com/docs/5.4/validation#available-validation-rules

Enjoy!