I have the upload-csv function available on one portal. The incoming date format is d-m-Y (31-12-2019). For storing in DB, I have to shuffle its order to make it Y-m-d. In addition, I have to check for sanity/correctness of the date as well. Can someone suggest a decent way to do this? I can do it in default PHP, but laravel should be more powerful, right?
Yes, thanks. I am using the validator-after function, and the incoming data is via CSV import, not request. Can you help me a bit more to guide how to run this check inside validator-after function, as I don't seem to have a request variable in there?
Thanks, and sorry for perhaps a novice question!
$validator->after(function ($validator) use ($importData_arr)
{
....
}