PHP code example of marshmallow / validation

1. Go to this page and download the library: Download marshmallow/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/ */

    

marshmallow / validation example snippets


use Illuminate\Support\Facades\Validator;
use Marshmallow\Validation\Rules\Creditcard;
use Marshmallow\Validation\Rules\Hexadecimalcolor;
use Marshmallow\Validation\Rules\Username;

$validator = Validator::make($request->all(), [
    'color' => new Hexadecimalcolor([3, 6]), // pass rule as object
    'number' => ['

// example
'iban' => 'Please enter IBAN number!',