mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
rm !empty
This commit is contained in:
parent
3cb906a05f
commit
2d59517c35
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue