seytar/lumen-form-request

Laravel Form Request adaptation for Lumen framework.

Installs: 112

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 11

Type:project

1.5 2018-10-18 00:07 UTC

This package is not auto-updated.

Last update: 2024-11-16 22:34:15 UTC


README

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!