2017 © Pedro Peláez
 

project lumen-form-requests

Missing form requests functionality for lumen, ported from laravel framework.

image

iocaste/lumen-form-requests

Missing form requests functionality for lumen, ported from laravel framework.

  • Saturday, March 31, 2018
  • by iocaste
  • Repository
  • 0 Watchers
  • 0 Stars
  • 745 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 97 % Grown

The README.md

lumen-form-requests

Quality Score Software License Latest Version Total Downloads , (*1)

Missing form requests functionality for lumen, ported from laravel framework., (*2)

Installation

  • Install as composer package
composer require noitran/lumen-form-requests
  • Open your bootstrap/app.php and register as service provider
$app->register(Noitran\Form\Providers\FormRequestServiceProvider::class);

Usage

Refer to the official laravel documentation about form request usage, (*3)

https://laravel.com/docs/5.7/validation#form-request-validation, (*4)

Example Request

<?php

namespace App\Http\Requests;

use Noitran\Microservice\Foundation\Http\Requests\Request;

class CreateUserRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        $rules = [
            'email' => [
                'required',
                'email',
                'unique:users,email',
            ],
            'password' => [
                'required',
            ],
        ];
    }
}

Usage in Controller

<?php

namespace App\Http\Controllers;

use App\Http\Requests\CreateUserRequest;
use App\Http\Controllers\Controller;

class UsersController extends Controller
{
    /**
     * Store a new user.
     *
     * @param CreateUserRequest $request
     * @return Response
     */
    public function store(CreateUserRequest $request)
    {
        // store user
    }
}

The Versions

31/03 2018

dev-master

9999999-dev

Missing form requests functionality for lumen, ported from laravel framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

by John.Doe

laravel api lumen

31/03 2018

v1.0.0-beta.1

1.0.0.0-beta1

Missing form requests functionality for lumen, ported from laravel framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

by John.Doe

laravel api lumen