From cf89c44a62b3fc3704600e10e4ab4d9fd375fbc6 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Thu, 5 Sep 2024 18:33:05 -0500 Subject: [PATCH] improve import --- app/Imports/Sheets/DailyChangesSheet.php | 2 +- app/Models/Transaction.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Imports/Sheets/DailyChangesSheet.php b/app/Imports/Sheets/DailyChangesSheet.php index 404bed9..635dd9f 100644 --- a/app/Imports/Sheets/DailyChangesSheet.php +++ b/app/Imports/Sheets/DailyChangesSheet.php @@ -31,7 +31,7 @@ class DailyChangesSheet implements ToCollection, WithHeadingRow, WithValidation, 'total_market_value' => $dailyChange['total_market_value'], 'total_cost_basis' => $dailyChange['total_cost_basis'], 'total_gain' => $dailyChange['total_gain'], - 'total_dividends' => $dailyChange['total_dividends'], + 'total_dividends_earned' => $dailyChange['total_dividends'], 'realized_gains' => $dailyChange['realized_gains'], 'annotation' => $dailyChange['annotation'], ]); diff --git a/app/Models/Transaction.php b/app/Models/Transaction.php index 52f352e..0e6feab 100644 --- a/app/Models/Transaction.php +++ b/app/Models/Transaction.php @@ -160,7 +160,7 @@ class Transaction extends Model } // get the holding for a symbol and portfolio (or create one) - $holding = Holding::firstOrNew([ + $holding = Holding::firstOrCreate([ 'portfolio_id' => $this->portfolio_id, 'symbol' => $this->symbol ], [