vlauciani/laravel-validation-rules

Validation rules for Laravel.

v1.3.0 2022-05-31 07:11 UTC

This package is auto-updated.

Last update: 2024-10-29 06:19:19 UTC


README

Tests Packagist License Total Downloads

Installation

composer require vlauciani/laravel-validation-rules:^1.0.0

Available Rules

RFC3339Extended

PHP doesn't validate correctly RFC3339: laravel/framework#35387

  • for example 2020-12-21T23:59:59+00:00 or 2020-12-21T23:59:59Z return false but it is true.

this Rule uniform the date in format: YYYY-MM-DDThh:mm:ss.mmm+nn:nn

Usage

<?php
namespace App\Api\Controllers;
use App\Http\Controllers\Controller;
use VLauciani\LaravelValidationRules\Rules\RFC3339ExtendedRule;

class MyController extends Controller
{
    public function index()
    {
        $myData = ['starttime' => '2022-04-06T12:00:00.123+00:00']
        Validator::make($myData, [
            'starttime'           => [new RFC3339ExtendedRule()],
        ])->validate();
    }
}

Contribute

Thanks to your contributions!

Here is a list of users who already contributed to this repository:

Author

(c) 2022 Valentino Lauciani vlauciani[at]gmail.com

Thanks to