Move vaCentral config to its own config file and ServiceProvider

This commit is contained in:
Nabeel Shahzad 2018-03-11 18:14:34 -05:00
parent 7cc3fc6a3a
commit d90e118f56
4 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,19 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use VaCentral\VaCentral;
/**
* Bootstrap the vaCentral library
* @package App\Providers
*/
class vaCentralServiceProvider extends ServiceProvider
{
public function boot()
{
if(filled(config('vacentral.api_key'))) {
VaCentral::setApiKey(config('vacentral.api_key'));
}
}
}

View File

@ -84,6 +84,7 @@ return [
App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\vaCentralServiceProvider::class,
],
'aliases' => [

16
config/vacentral.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/**
* vaCentral Configurations
*/
return [
/**
* Your vaCentral API key
*/
'api_key' => env('VACENTRAL_API_KEY', ''),
/**
* vaCentral API URL. You likely don't need to change this
*/
'api_url' => 'https://api.vacentral.net',
];

View File

@ -19,8 +19,6 @@ return [
# overrides phpvms.php
'phpvms' => [
'vacentral_api_key' => '',
/**
* The ISO "Currency Code" to use, the list is in config/money.php
*
@ -35,6 +33,10 @@ return [
'default' => 'default',
],
'vacentral' => [
'api_key' => '',
],
# overrides cache.php
'cache' => [
'default' => '$CACHE_DRIVER$',