fix: use requested symbol name for market data providers

This commit is contained in:
hackerESQ
2025-01-28 13:30:12 -06:00
parent 53ebe28b14
commit c32641ec34
3 changed files with 6 additions and 2 deletions
@@ -36,7 +36,7 @@ class AlphaVantageMarketData implements MarketDataInterface
return new Quote([
'name' => Arr::get($fundamental, 'Name'),
'symbol' => Arr::get($fundamental, 'Symbol'),
'symbol' => $symbol,
'market_value' => Arr::get($quote, '05. price'),
'fifty_two_week_high' => Arr::get($fundamental, '52WeekHigh'),
'fifty_two_week_low' => Arr::get($fundamental, '52WeekLow'),
@@ -35,7 +35,7 @@ class YahooMarketData implements MarketDataInterface
return new Quote([
'name' => $quote->getLongName() ?? $quote->getShortName(),
'symbol' => $quote->getSymbol(),
'symbol' => $symbol,
'market_value' => $quote->getRegularMarketPrice(),
'fifty_two_week_high' => $quote->getFiftyTwoWeekHigh(),
'fifty_two_week_low' => $quote->getFiftyTwoWeekLow(),
+4
View File
@@ -6,11 +6,15 @@ use App\Http\Controllers\HoldingController;
use App\Http\Controllers\DashboardController;
use App\Http\Controllers\PortfolioController;
use App\Http\Controllers\TransactionController;
use App\Interfaces\MarketData\MarketDataInterface;
use App\Http\Controllers\ConnectedAccountController;
use App\Http\Controllers\InvitedOnboardingController;
use Laravel\Jetstream\Http\Controllers\Livewire\PrivacyPolicyController;
use Laravel\Jetstream\Http\Controllers\Livewire\TermsOfServiceController;
Route::get('/test', function() {
dd(app(MarketDataInterface::class)->quote('BTCUSD'));
});
Route::get('/', function () {
if (!config('investbrain.self_hosted', true) && View::exists('landing-page::index')) {