2017 © Pedro Peláez
 

library lumen-request-validate

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class

image

pearl/lumen-request-validate

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class

  • Wednesday, May 30, 2018
  • by pearlkrishn
  • Repository
  • 0 Watchers
  • 1 Stars
  • 443 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 233 % Grown

The README.md

Total Downloads Latest Stable Version License, (*1)

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class., (*2)

Installation

composer require pearl/lumen-request-validate, (*3)

  • Add the service provider in bootstrap/app.php

$app->register(Pearl\RequestValidate\RequestServiceProvider::class);, (*4)

Next step is create your validator class using below console comment, (*5)

php artisan make:request {class_name}, (*6)

Request validator class will be create under app/Http/Requests folder., (*7)

#### Example:, (*8)

Login validation class ```php <?php namespace App\Http\Requests;, (*9)

use Pearl\RequestValidate\RequestAbstract;, (*10)

class Login extends RequestAbstract { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; }, (*11)

/**
 * Get the validation rules that apply to the request.
 *
 * @return array
 */
public function rules()
{
    return [
        "username" => "required",
        "password" => "required"
    ];
}

/**
 * Get custom messages for validator errors.
 *
 * @return array
 */
public function messages()
{
    return [];
}

}, (*12)



## How to use? Now you can use your Request class in method injections ```php ... use App\Http\Requests\Login; class ExampleController extends Controller { public function auth(Login $request) { //Login logic goes here } ...

The Versions

30/05 2018

dev-master

9999999-dev

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class

  Sources   Download

MIT

The Requires

 

by Avatar pearlkrishn

lumen validation form-validation form-request lumen-package form-request-validation lumen-request-validate

30/05 2018

1.0.1

1.0.1.0

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class

  Sources   Download

MIT

The Requires

 

by Avatar pearlkrishn

lumen validation form-validation form-request lumen-package form-request-validation lumen-request-validate

14/02 2018

1.0

1.0.0.0

Lumen doesn't have form request validator seperatly. This package helps developers to segregate the validation layer from the controller to a separate dedicated class

  Sources   Download

MIT

The Requires

 

by Avatar pearlkrishn

lumen validation form-validation form-request lumen-package form-request-validation lumen-request-validate