Validate your input data in a simple way, an easy way and right way. no framework required. For simple or large. project.

Overview

wepesi_validation

this module will help to do your own input validation from http request POST or GET.

INTEGRATION

The integration is the simple thing to do. First you neeed to create a new instance of Validate whitch will be use to do our validation. While have the instance of validation, you can access check method, with take two parameters, the source and rules;

    $valid=new Validate($source);
    $valid->check($source,$rules);
  • source The source is array object of information to be checked.
    $source=[
        "name"=>"wepesi",
        "email"=>"[email protected]",
        "link"=>"https://github.com/bim-g/wepesi_validation/",
        "age"=>1
        ];
  • rules The rules contains all the rule for each element of the source to be checked. you start with the name of the index key you want to check, the with the method you want to check. different method are now available according to you need.

  • Validation Method now you can validate your keys according to a specify type witch are:

    • string
    • number
    • ...
    // rules 
    $rules=[
        "email"=>$valid->string("name")->email()->min(9)->max(50)->required()->check(),    
        "year"=>$valid->number("year")->email()->min(35)->max(60)->required()->check()    
    ];

in the example bellow, for the first rule

    "email"=>$valid->string("name")->email()->min(9)->max(50)->required()->check()
    
    // check `email` keys should be a:
    // - string: type of the value to be check should be a string
    // - email: that string should be a email
    // - min:9=> the email should have minimum caracters  9 caracter
    // - min:9=> the email should have maximum caracters should exid 50 caracters

STRING method allow to validation: - required: this to specify that the key will be required means is not null. - min: this will check the minimum length of a string, - max: this will check the maximum length of a string, - email: this will check if the value is an email, - url: this will check if the value is url or a link, - matches: this is used tho check if two key has the same value, you should specify the second field to check.

In the example bellow, you can see a complete procured on how to validate data-source

    $source=[
        "name"=>"wepesi",
        "email"=>"[email protected]",
        "link"=>"https://github.com/bim-g/wepesi_validation/",
        "age"=>1
        ];
$valid=new Validate($source);
    $rules=[
        "name"=>$validate->string("name")->required()->min(3)->max(30)->check(),
        "email"=>$validate->string("email")->required()->min(3)->max(60)->email()->check(),
        "link"=>$validate->string("link")->required()->min(3)->max(60)->url()->check(),
        "age"=>$validate->number("age")->required()->positive()->check()
    ];
    
    $valid->check($source,$rules);
    var_dump($valid->passed()); // if everything is correct return true
    var_dump($valid->errors()); // return all errors according to the validation type
Comments
  • Add option resolver support.

    Add option resolver support.

    The option resolver will be helpfull in order to specify what soes the method is waiting for in order to prevent undefined errors. The option resolver sould be also revised.

    documentation enhancement 
    opened by bim-g 1
  • V3-beta

    V3-beta

    [[ENH]App: setup structure app] [[UPD] refactoring schema contract and provider. [[UPD] refactoring string schema. [[ENH] Add option resolver to app manage undefined key value.]

    [[ENH] Exception as trait to be available everywhere.]

    [[ENH] Implement string validation with and example.] [[ENH] Implement contract provider validator.] [[UPD] Remove useless module file] [[UPD] Add schema module to separate valition from schema for better c…] [UPD] string Validation and schema test

    [UPD] refactor validate module to focus only on validation.

    [UPD] refactor string example

    [UPD] refactor number validation schema and validator module

    [UPD] refactor number validation schema and validator example

    [ENH] refactor number validation schema provider contract and validat…

    [UDP] add Number support new structure.

    [ENH] Refactor DateValidator et DateSchema

    [UPD] Refactor and add DateValidator from test

    [UPD] set NumberValidator to final

    [ENH] Refactoring boolean validator and schemaprovider

    [UPD] Refactoring boolean example to be mre clear

    [FIX] Refactoring BooleanSchematest, call the right class module

    [FIX] change module extends from schema module class

    [UPD] remove useless module

    [UPD] setup date to example module for better test

    [UPD] remove useless field value on constructor, it will be get from …

    closes #51 closes #46 closes #30 closes #53 closes #54 closes #55

    bug documentation enhancement help wanted 
    opened by bim-g 1
  • DRAFT:[ENH] add support validate array object

    DRAFT:[ENH] add support validate array object

    [ENH] add support validate array object [[UPD] update documentation.]

    [[UPD] remove set manually schema class and review validate module.

    [[UPD] add public to class methods.]

    [[ENH] add support for array validation.]

    [[DOC] update array documentations.] closes #31 closes #58

    enhancement 
    opened by bim-g 0
  • Add optionResolver

    Add optionResolver

    The OptionsResolver component is an improved replacement for the array_replace PHP function. It allows you to create an options system with required options, defaults, validation (type, value), normalization and more.

    enhancement 
    opened by bim-g 0
  • [UPD] Refactoring app structure

    [UPD] Refactoring app structure

    fix proble with composer auto deployement cause of invalide schema rules. closes #48

    Problem with repetitive method on defferent class, refactor to remove repetitive method for the sema implementation closes #49

    bug enhancement 
    opened by bim-g 0
Releases(v2.0.0.0)
  • v2.0.0.0(Dec 9, 2022)

    What's Changed

    • [UPD][TRA] add boolean translate by @bim-g in https://github.com/bim-g/wepesi_validation/pull/40
    • [ENH] make standard transalion module by @bim-g in https://github.com/bim-g/wepesi_validation/pull/42
    • Refactor project app structure by @bim-g in https://github.com/bim-g/wepesi_validation/pull/44
    • [ENH]String Validation: add string validation script and test by @bim-g in https://github.com/bim-g/wepesi_validation/pull/47
    • [UPD] Refactoring app structure by @bim-g in https://github.com/bim-g/wepesi_validation/pull/50
    • [UPD] rename validation schema, but removing "V" before it name. by @bim-g in https://github.com/bim-g/wepesi_validation/pull/52
    • V3-beta by @bim-g in https://github.com/bim-g/wepesi_validation/pull/56

    Full Changelog: https://github.com/bim-g/wepesi_validation/compare/1.8.4...v2.0.0.0

    Source code(tar.gz)
    Source code(zip)
  • 1.8.4(Jan 2, 2022)

    What's Changed

    • [UPD] update translation for vnumber by @bim-g in https://github.com/bim-g/wepesi_validation/pull/38

    Full Changelog: https://github.com/bim-g/wepesi_validation/compare/v1.8.0...1.8.4

    Source code(tar.gz)
    Source code(zip)
  • v1.8.0(Dec 29, 2021)

    What's Changed

    • Update composer.js by @bim-g in https://github.com/bim-g/wepesi_validation/pull/32
    • Update to Apache v2 License by @bim-g in https://github.com/bim-g/wepesi_validation/pull/33
    • [FEAT][TRA] add tranlate class module by @bim-g in https://github.com/bim-g/wepesi_validation/pull/35

    Full Changelog: https://github.com/bim-g/wepesi_validation/compare/v1.7...v1.8.0

    Source code(tar.gz)
    Source code(zip)
  • v1.7(Oct 22, 2021)

    What's Changed

    • Version emmanuel by @Domeshow in https://github.com/bim-g/wepesi_validation/pull/19
    • feat: add validate date module by @bim-g in https://github.com/bim-g/wepesi_validation/pull/20
    • feat: add composer by @bim-g in https://github.com/bim-g/wepesi_validation/pull/24
    • fix: raname class folder name to src by @bim-g in https://github.com/bim-g/wepesi_validation/pull/29

    Full Changelog: https://github.com/bim-g/wepesi_validation/compare/v1.3...v1.7

    Source code(tar.gz)
    Source code(zip)
  • v1.3(May 7, 2021)

Owner
Boss
Web Developer @kivudesign
Boss
Laravel is accessible, powerful, and provides tools required for large, robust applications.

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be trul

Web & Mobile | eCommerce | Full-Stack Developer 4 Nov 24, 2022
Get estimated read time of an article. Similar to medium.com's "x min read". Multilingual including right-to-left written languages. Supports JSON, Array and String output.

Read Time Calculates the read time of an article. Output string e.g: x min read or 5 minutes read. Features Multilingual translations support. Static

Waqar Ahmed 8 Dec 9, 2022
Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords.

Laravel Otpify ?? Introduction Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords. Install

Prasanth Jayakumar 2 Sep 2, 2022
Websockets for Laravel. Done right.

Bring the power of WebSockets to your Laravel application. Drop-in Pusher replacement, SSL support, Laravel Echo support and a debug dashboard are just some of its features.

Beyond Code 4.6k Jan 6, 2023
Login system designed by fragX to validate the user and prevent unauthorized access to confidential data.

Login_System v.0.1 Login system designed by fragX to validate the user and prevent unauthorized access to confidential data. ?? Features Sign In and S

fragX 1 Jan 28, 2022
A Laravel package to upload large files

A Laravel package to upload large files

Payne 896 Dec 26, 2022
Keyword Generator Tool helps you discover keyword opportunities related to your query input.

This plugin simply helps you discover keyword opportunities related to your query input. Installation Download the zip file of the repository or clone

WP Refers 1 May 3, 2022
Easily validate data attributes through a remote request

Laravel Remote Rule Easily validate data attributes through a remote request. This package allows you to define a subset of custom rules to validate a

H-FARM Innovation 27 Nov 20, 2022
Laravel breeze is a PHP Laravel library that provides Authentication features such as Login page , Register, Reset Password and creating all Sessions Required.

About Laravel breeze To give you a head start building your new Laravel application, we are happy to offer authentication and application starter kits

null 3 Jul 30, 2022
Laravel Livewire (TALL-stack) form generator with realtime validation, file uploads, array fields, blade form input components and more.

TALL-stack form generator Laravel Livewire, Tailwind forms with auto-generated views. Support Contributions Features This is not an admin panel genera

TinaH 622 Jan 2, 2023
A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards.

TALL multiselect cards A TALL-based Laravel Livewire component to replace the (multiple) select HTML input form with beautiful cards. Table of content

Frederic Habich 19 Dec 14, 2022
Html-sanitizer - The HtmlSanitizer component provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a document's DOM.

HtmlSanitizer Component The HtmlSanitizer component provides an object-oriented API to sanitize untrusted HTML input for safe insertion into a documen

Symfony 201 Dec 23, 2022
Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.

DMS Filter Component This library provides a service that can be used to filter object values based on annotations Install Use composer to add DMS\Fil

Rafael Dohms 89 Nov 28, 2022
A Laravel package that allows you to validate your config values and environment.

Table of Contents Overview Installation Requirements Install the Package Publishing the Default Rulesets Usage Creating a Validation Ruleset Using the

Ash Allen 152 Dec 15, 2022
🛂 Use this package to validate the identity card from your country using laravel validation rules.

Identity Card Checker Laravel Validation Rules Use this package to validate the identity card number from your country Installation You can install th

David Torralbo Pérez 13 Feb 8, 2022
An easy way to get vendor and package data from Packagist via API calls

Laravel Packagist Laravel Packagist (LaravelPackagist) is a package for Laravel 5 to interact with the packagist api quickly and easily. Table of cont

Jeremy Kenedy 5 Jul 18, 2022
A simple laravel package to validate console commands arguments and options.

Command Validator A simple laravel package to validate console commands arguments and options. Installation Require/Install the package using composer

Touhidur Rahman 20 Jan 20, 2022
A quick and incomplete example of how to validate a form using a FormValidator class on the simple-mvc

Simple MVC Description This repository is a simple PHP MVC structure from scratch. It uses some cool vendors/libraries such as Twig and Grumphp. For t

Romain Clair 1 Nov 24, 2021
Laravel package to generate and to validate a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

Laravel Uuid Laravel package to generate and to validate a universally unique identifier (UUID) according to the RFC 4122 standard. Support for versio

Christoph Kempen 1.7k Dec 28, 2022