Linhdanchu3296 / lumen-form-request by Linhdanchu

Laravel Form Request adaptation for Lumen framework.
77
0
1
Package Data
Maintainer Username: Linhdanchu
Package Create Date: 2019-11-22
Package Last Update: 2019-11-22
Language: PHP
License: MIT
Last Refreshed: 2024-12-15 15:22:03
Package Statistics
Total Downloads: 77
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

lumen-form-request

Laravel Form Request adaptation for Lumen framework

How to install

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

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

Example

<?php

namespace App\Http\Requests;

use Linhdanchu\Requests\FormRequest;

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

	public function rules()
	{
		return [
			'mac_address' => 'required|unique:devices,mac_address'
		];
	}
}