label('Fetch Prices Now') ->icon('heroicon-o-arrow-down-tray') ->requiresConfirmation() ->modalHeading('Fetch latest Brent prices?') ->modalDescription('Pulls the latest Brent crude prices from EIA (falls back to FRED if EIA is unavailable).') ->action(function () { $result = Artisan::call('oil:fetch'); if ($result === 0) { Notification::make() ->title('Brent prices fetched successfully') ->success() ->send(); } else { Notification::make() ->title('Fetch failed') ->body('Both EIA and FRED failed. Check API Logs for details.') ->danger() ->send(); } }), ]; } protected function getHeaderWidgets(): array { return [ BrentPriceChartWidget::class, ]; } }