PHP code example of pxianyu / laravel-validation

1. Go to this page and download the library: Download pxianyu/laravel-validation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pxianyu / laravel-validation example snippets



namespace app\controller;

use support\Request;

class FooController
{
    public function bar(Request $request) 
    {
        $validator = validator($request->post(), [
            'title' => '


namespace app\controller;

use support\Request;
use WebmanTech\Polyfill\LaravelRequest;

class FooController
{
    public function bar(Request $request) 
    {
        $validator = validator(LaravelRequest::wrapper($request)->all(), [
           'file' => '
bash

namespace app\controller;

use support\Request;
use WebmanTech\Polyfill\LaravelRequest;

class FooController
{
    public function bar(Request $request) 
    {
        LaravelRequest::wrapper($request)->validate([
            'file' => '