2017-06-09 02:28:26 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2017-12-08 04:06:12 +08:00
|
|
|
use Illuminate\Support\Facades\Schema;
|
2017-06-09 02:28:26 +08:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2017-12-10 11:56:26 +08:00
|
|
|
use App\Repositories\SettingRepository;
|
2017-12-20 10:19:36 +08:00
|
|
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
|
|
|
use App\Models\Flight;
|
|
|
|
use App\Models\Pirep;
|
2017-06-11 07:27:19 +08:00
|
|
|
|
2017-06-09 02:28:26 +08:00
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2017-12-08 04:06:12 +08:00
|
|
|
Schema::defaultStringLength(191);
|
|
|
|
|
2017-12-20 10:19:36 +08:00
|
|
|
Relation::morphMap([
|
|
|
|
'flights' => Flight::class,
|
|
|
|
'pireps' => Pirep::class,
|
|
|
|
]);
|
|
|
|
|
2017-12-10 11:56:26 +08:00
|
|
|
$this->app->bind('setting', SettingRepository::class);
|
|
|
|
|
2017-12-08 07:22:15 +08:00
|
|
|
//\VaCentral\VaCentral::setVaCentralUrl(config('phpvms.vacentral_api_url'));
|
|
|
|
if(!empty(config('phpvms.vacentral_api_key'))) {
|
|
|
|
\VaCentral\VaCentral::setApiKey(config('phpvms.vacentral_api_key'));
|
|
|
|
}
|
|
|
|
|
2017-07-06 12:05:17 +08:00
|
|
|
# if there's a local.conf.php in the root, then merge that in
|
|
|
|
if(file_exists(base_path('local.conf.php'))) {
|
2017-12-08 07:22:15 +08:00
|
|
|
$local_conf = include base_path('local.conf.php');
|
2017-07-06 12:05:17 +08:00
|
|
|
$config = $this->app['config']->get('phpvms', []);
|
|
|
|
$this->app['config']->set(
|
|
|
|
'phpvms',
|
|
|
|
array_merge($config, $local_conf)
|
|
|
|
);
|
|
|
|
}
|
2017-06-09 02:28:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2017-07-04 14:05:37 +08:00
|
|
|
|
2017-06-09 02:28:26 +08:00
|
|
|
}
|
|
|
|
}
|