Add config.php at root; include configuration overhaul and then fixes to the installer #156

This commit is contained in:
Nabeel Shahzad
2018-01-29 13:16:39 -06:00
parent b1759d9276
commit f660af5c3b
17 changed files with 337 additions and 194 deletions

View File

@@ -2,12 +2,10 @@
namespace App\Providers;
use Log;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use App\Repositories\SettingRepository;
use Illuminate\Database\Eloquent\Relations\Relation;
use App\Models\Flight;
use App\Models\Pirep;
class AppServiceProvider extends ServiceProvider
{
@@ -18,29 +16,18 @@ class AppServiceProvider extends ServiceProvider
{
Schema::defaultStringLength(191);
Relation::morphMap([
'flights' => Flight::class,
'pireps' => Pirep::class,
]);
$this->app->bind('setting', SettingRepository::class);
//\VaCentral\VaCentral::setVaCentralUrl(config('phpvms.vacentral_api_url'));
if(!empty(config('phpvms.vacentral_api_key'))) {
\VaCentral\VaCentral::setApiKey(config('phpvms.vacentral_api_key'));
}
# if there's a local.conf.php in the root, then merge that in
if(file_exists(base_path('config.php'))) {
/*if(file_exists(base_path('config.php'))) {
$local_conf = include base_path('config.php');
foreach($local_conf as $namespace => $override_config) {
$config = $this->app['config']->get($namespace, []);
$this->app['config']->set(
$namespace,
array_merge($config, $override_config)
);
$update_config = array_merge_recursive($config, $override_config);
$this->app['config']->set($namespace, $update_config);
}
}
}*/
}
/**