phpvms/app/Providers/BindServiceProviders.php
Nabeel S 3d211535f7
Remove Google Analytics #728 (#745)
* Remove Google Analytics #728

* Remove config file

* Don't set the vacentral url
2020-06-04 10:36:55 -04:00

46 lines
1.1 KiB
PHP
Executable File

<?php
namespace App\Providers;
use App\Contracts\AirportLookup;
use App\Contracts\Metar;
use Illuminate\Support\ServiceProvider;
use VaCentral\Contracts\IVaCentral;
use VaCentral\VaCentral;
class BindServiceProviders extends ServiceProvider
{
public function boot(): void
{
/*
* Bind the class used to fullfill the Metar class contract
*/
$this->app->bind(
Metar::class,
config('phpvms.metar_lookup')
);
/*
* Bind the class used to fullfill the AirportLookup class contract
*/
$this->app->bind(
AirportLookup::class,
config('phpvms.airport_lookup')
);
$this->app->bind(
IVaCentral::class,
function ($app) {
$client = new VaCentral();
// Set API if exists
if (filled(config('vacentral.api_key'))) {
$client->setApiKey(config('vacentral.api_key'));
}
return $client;
}
);
}
}