vlauciani / laravel-validation-rules
Validation rules for Laravel.
Installs: 323
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^7.4|^8.0|^8.1
- illuminate/support: ^8.0|^9.0
Requires (Dev)
- orchestra/testbench: ^6.0|^7.0
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.3
README
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
or2020-12-21T23:59:59Z
returnfalse
but it istrue
.
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