Content-Length: 254776 | pFad | http://github.com/zalasid/custom-PHP-server-side-validation

7C GitHub - zalasid/custom-PHP-server-side-validation: Server side validation helper class in PHP
Skip to content

zalasid/custom-PHP-server-side-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHP Rest API Custom validation rules Helper Class.

This is Package that will help you to set custom validation at server side.

Import database

Import a dummy database. Use mydb.sql file for that.

How to use

I have create one class file that is validation.php You can use that class for a validate your request parameters. Simply put a validate rule array and request array into method and that will check your validations for your request.

// convert to array
$request_data = json_decode($json_request,true);

// create a rule array
$rules = array(
        "first_name"=>"required",
        "last_name"=>"required",
        "age"=>"required|integer",
        "email"=>"email|unique:user_details",
        "contact"=>"required|contactNumber",
        "gender"=>"required"
);
// check a validation using a validation class method.
$isValid = $this->checkValidation($request_data,$rules);








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/zalasid/custom-PHP-server-side-validation

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy