Return null on empty value

This commit is contained in:
Nabeel Shahzad
2021-01-25 17:03:48 -05:00
parent 3f92191126
commit bda1a91117
3 changed files with 8 additions and 7 deletions

View File

@@ -117,7 +117,8 @@ class ImportService extends Service
// turn it into a collection and run some filtering
$row = collect($row)->map(function ($val, $index) {
return trim($val);
$val = trim($val);
return empty($val) ? null : $val;
})->toArray();
// Try to validate