feat:adds LLM capabilities to chat with your portfolios and holdings
This commit is contained in:
@@ -24,6 +24,21 @@ class HoldingController extends Controller
|
||||
->portfolio($portfolio->id)
|
||||
->firstOrFail();
|
||||
|
||||
return view('holding.show', compact(['portfolio', 'holding']));
|
||||
$formattedTransactions = $this->getFormattedTransactions($holding);
|
||||
|
||||
return view('holding.show', compact(['portfolio', 'holding', 'formattedTransactions']));
|
||||
}
|
||||
|
||||
public function getFormattedTransactions($holding)
|
||||
{
|
||||
$formattedTransactions = '';
|
||||
foreach($holding->transactions->where('symbol', $holding->symbol)->sortByDesc('date') as $transaction) {
|
||||
$formattedTransactions .= " * ".$transaction->date->format('Y-m-d')
|
||||
." ". $transaction->transaction_type
|
||||
." ". $transaction->quantity
|
||||
." @ ". $transaction->cost_basis
|
||||
." each \n\n";
|
||||
}
|
||||
return $formattedTransactions;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user