PHP code example of f9webltd / laravel-validation-rules

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

    

f9webltd / laravel-validation-rules example snippets


use F9Web\ValidationRules\Rules\TitleCase;

// ...

$request->validate([
    'team' => ['

use F9Web\ValidationRules\Rules\DomainRestrictedEmail;

// ...

$request->validate([
    'email' => [
        '      ]),
    ],
]);

use F9Web\ValidationRules\Rules\HexColourCode;

(new HexColourCode());

use F9Web\ValidationRules\Rules\HexColourCode;

(new HexColourCode())->withoutPrefix()->longFormat();

use F9Web\ValidationRules\Rules\NumberParity;

// ...

$request->validate([
    'amount' => [
        '

use F9Web\ValidationRules\Rules\NumberParity;

// ...

$request->validate([
    'amount' => [
        '

use F9Web\ValidationRules\Rules\StringContains;

// ...

$request->validate([
    'description' => [
        '

use F9Web\ValidationRules\Rules\StringContains;

// ...

$request->validate([
    'description' => [
        '   ],
]);

use F9Web\ValidationRules\Rules\StrongPassword;

// ...

$request->validate([
    'password' => [
        '

use F9Web\ValidationRules\Rules\StrongPassword;

// ...

$request->validate([
    'password' => [
        'ters(false)
            ->forceNumbers()
            ->forceSpecialCharacters()
            // ->withSpecialCharacters('£$*%^'),
    ],
]);
 bash
php artisan vendor:publish --provider="F9Web\ValidationRules\ValidationRulesServiceProvider"