2017 © Pedro Peláez
 

library laravel-request

Simple management laravel validation.

image

csi0n/laravel-request

Simple management laravel validation.

  • Friday, May 12, 2017
  • by csi0n
  • Repository
  • 1 Watchers
  • 0 Stars
  • 138 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Laravel Request

简介

简单的分离Laravel请求规则, (*1)

实例

表单
<form action="{{route('test.update',['id'=>1])}}" method="post">
    {{csrf_field()}}
    @crulemethod("other_method")
    First name:<br>
    <input type="text" name="first" value="c">
    <br>
    Last name:<br>
    <input type="text" name="last" value="si0n">
    <br><br>
    <input type="submit" value="Submit">
</form>
Request中
   function setCRule()
    {
        CRule::COMMON([
            'first' => 'required'
        ]);
        CRule::CUSTOM('other_method',[
            'last' => 'required'
        ]);
//        CRule::POST([
//            'first' => 'required',
//            'last' => 'required'
//        ]);
//        CRule::PATCH([
//            'last' => 'required'
//        ]);
    }

使用方法

app.php->providers中添加:, (*2)

csi0n\Laravel\Request\Providers\CLaravelRequestServiceProvider::class

app.php->aliases中添加:, (*3)

'CRule' => csi0n\Laravel\Request\Facades\CLaravelRequestFacade::class

使用的Request需要继承, (*4)

csi0n\Laravel\Request\Requests\CLaravelRequest

The Versions

12/05 2017

dev-master

9999999-dev

Simple management laravel validation.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by Avatar csi0n

laravel helper requests

12/05 2017

1.0

1.0.0.0

Simple management laravel validation.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by Avatar csi0n

laravel helper requests

08/02 2017

0.1

0.1.0.0

Simple management laravel validation.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by Avatar csi0n

laravel helper requests