skip to Main Content

Laravel date validation erroring for string "today"

I'm using laravel validation for a date field like this: Validator::make($shipment, [ 'collection_date' => 'required|date', ... and I'm sending json with this field: "collection_date": "today", It's giving this error: { "collection_date": [ "The collection date is not a valid date."…

VIEW QUESTION

Validator class in Laravel 10

In my controller I validate fields of my json request. To obey single responsibility, I want to create a custom Validator class and put following code to my validator class. When I type: php artisan make:validator MyValidator I found out…

VIEW QUESTION
Back To Top
Search