rm !empty
This commit is contained in:
@@ -44,7 +44,7 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migration
|
||||
// Update the asset_eol_date column with the calculated value if it doesn't exist
|
||||
Asset::whereNull('asset_eol_date')->with('model')->chunkById(500, function ($assets) {
|
||||
foreach ($assets as $asset) {
|
||||
if (!empty($asset->model->eol) && !empty($asset->purchase_date)) {
|
||||
if ($asset->model->eol && $asset->purchase_date) {
|
||||
try {
|
||||
$asset_eol_date = CarbonImmutable::parse($asset->purchase_date)->addMonths($asset->model->eol)->format('Y-m-d');
|
||||
$asset->update(['asset_eol_date' => $asset_eol_date]);
|
||||
|
||||
Reference in New Issue
Block a user