2017 © Pedro Peláez
 

beta validate

A simple Laravel 5 package to validate form inputs on the go

image

richardkeep/validate

A simple Laravel 5 package to validate form inputs on the go

  • Wednesday, January 6, 2016
  • by RichardKeep
  • Repository
  • 1 Watchers
  • 4 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Easily Validate Form Inputs in Laravel

Installation

First, pull in the package through Composer., (*1)

composer require richardkeep/validate

The package will automatically register its service provider., (*2)

To publish the config file to config/richard.php run:, (*3)

php artisan vendor:publish --provider="Richardkeep\Validate\RichardkeepServiceProvider", (*4)

This is the default contents of the configuration:, (*5)

return [
    'rules' => [
        'password' => 'required|min:3'
    ]
];

Usage

Place this code in your layout file or anywhere you want to use it., (*6)

<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
@include('richard::validate')

for example,, (*7)

<!DOCTYPE html>
<html>
    <head>
        <title>Update Password</title>
    </head>
    <body>
        <div
            <label for="password">Password</label>
            <input type="password" id="password" class="form-control">
        </div>
    </body>
    <script src="https://code.jquery.com/jquery-2.2.4.min.js" defer></script>
    @include('richard::validate')
</html>

Ignore CSRF-Token Check

Open app\Http\Middleware\VerifyCsrfTokenCheck.php add `validate to the URI that should be excluded from CSRF check, (*8)

/**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'validate'
    ];

Customizations

Open config\richard.php and add more validation rules. For example,, (*9)

'rules' => [
    'password' => 'required|min:3',
    'name' => 'required|min:5', 
];

When a user starts typing, for example their email, the data is validated and the error message is displayed below the text box immediately., (*10)

Capture, (*11)

Please try it guys., (*12)

Pull requests are highly welcomed., (*13)

The Versions

06/01 2016

1.0.x-dev

1.0.9999999.9999999-dev

A simple Laravel 5 package to validate form inputs on the go

  Sources   Download

by Richard Keep

28/11 2015

dev-revert-2-patch-1

dev-revert-2-patch-1

A simple Laravel 5 package to validate form inputs on the go

  Sources   Download

by Richard Keep

24/11 2015

v1.0

1.0.0.0

A simple Laravel 5.1 package to validate form inputs on the go

  Sources   Download

by Richard Keep