Periksa apakah format tanggal yang valid dimasukkan di dalam Excel Impor PHP

try {
  Date::excelToDateTimeObject(trim($row[5]))->format('Y-m-d');
} catch (\Exception $exception) {
  throw ValidationException::withMessages([
    'file' => "contains incorrect date format, should be in Y-m-d format"]
  ]);
}
Lokesh003