fix: upgrade the exists() market data provider method

This commit is contained in:
hackerESQ
2025-01-28 20:32:43 -06:00
parent 0f135f4024
commit 4ece09368e
7 changed files with 49 additions and 42 deletions
+2 -1
View File
@@ -29,12 +29,13 @@ class SymbolValidationRule implements ValidationRule
{
$this->symbol = $value;
// Check if the symbol exists in the Market Data table first (avoid API call)
if (MarketData::find($this->symbol)) {
return;
}
// Check if the symbol exists in the Market Data table first (avoid API call)
// Then check against market data provider
if (! app(MarketDataInterface::class)->exists($value)) {
$fail('The symbol provided ('.$this->symbol.') is not valid');
}