chore: code style
This commit is contained in:
@@ -38,9 +38,9 @@ class CaptureDailyChange extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
Portfolio::with('holdings.market_data')->get()->each(function($portfolio){
|
||||
Portfolio::with('holdings.market_data')->get()->each(function ($portfolio) {
|
||||
|
||||
$this->line('Capturing daily change for ' . $portfolio->title);
|
||||
$this->line('Capturing daily change for '.$portfolio->title);
|
||||
|
||||
$total_cost_basis = $portfolio->holdings->sum('total_cost_basis');
|
||||
|
||||
@@ -48,7 +48,7 @@ class CaptureDailyChange extends Command
|
||||
|
||||
$realized_gains = $portfolio->holdings->sum('realized_gain_dollars');
|
||||
|
||||
$total_market_value = $portfolio->holdings->sum(function($holding) {
|
||||
$total_market_value = $portfolio->holdings->sum(function ($holding) {
|
||||
return $holding->market_data->market_value * $holding->quantity;
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@ class CaptureDailyChange extends Command
|
||||
'total_cost_basis' => $total_cost_basis,
|
||||
'total_gain' => $total_market_value - $total_cost_basis,
|
||||
'total_dividends_earned' => $total_dividends,
|
||||
'realized_gains' => $realized_gains
|
||||
'realized_gains' => $realized_gains,
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user