2024-08-01 13:53:10 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Register any application services.
|
|
|
|
|
*/
|
|
|
|
|
public function register(): void
|
|
|
|
|
{
|
2024-09-12 21:05:01 -05:00
|
|
|
if (!in_array(
|
|
|
|
|
$interface = config('investbrain.default', 'yahoo'),
|
|
|
|
|
array_keys(config('investbrain.interfaces', []))
|
|
|
|
|
)) {
|
|
|
|
|
throw new \Exception("Error: '$interface' is not a valid market data interface.");
|
|
|
|
|
}
|
2024-08-24 22:19:40 -05:00
|
|
|
|
|
|
|
|
$this->app->bind(
|
|
|
|
|
\App\Interfaces\MarketData\MarketDataInterface::class,
|
2024-09-12 21:05:01 -05:00
|
|
|
config("investbrain.interfaces.$interface")
|
2024-08-24 22:19:40 -05:00
|
|
|
);
|
2024-08-01 13:53:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bootstrap any application services.
|
|
|
|
|
*/
|
|
|
|
|
public function boot(): void
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
}
|