skip to Main Content

weird laravel validation in nested array

I tried some validation rule like: Boolean and Required file with nested array field, but always failing for example, I tried creating form request like this: <?php namespace AppHttpRequestsTest; use IlluminateFoundationHttpFormRequest; class Test extends FormRequest { public function validationData() {…

VIEW QUESTION

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