composer require vlauciani/laravel-validation-rules:^1.0.0
PHP doesn't validate correctly RFC3339: laravel/framework#35387
- for example
2020-12-21T23:59:59+00:00
or2020-12-21T23:59:59Z
returnfalse
but it istrue
.
this Rule uniform the date in format: YYYY-MM-DDThh:mm:ss.mmm+nn:nn
<?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();
}
}
Thanks to your contributions!
Here is a list of users who already contributed to this repository:
(c) 2022 Valentino Lauciani vlauciani[at]gmail.com