Move vaCentral config to its own config file and ServiceProvider
This commit is contained in:
19
app/Providers/vaCentralServiceProvider.php
Executable file
19
app/Providers/vaCentralServiceProvider.php
Executable 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'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -84,6 +84,7 @@ return [
|
|||||||
App\Providers\AuthServiceProvider::class,
|
App\Providers\AuthServiceProvider::class,
|
||||||
App\Providers\EventServiceProvider::class,
|
App\Providers\EventServiceProvider::class,
|
||||||
App\Providers\RouteServiceProvider::class,
|
App\Providers\RouteServiceProvider::class,
|
||||||
|
App\Providers\vaCentralServiceProvider::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
'aliases' => [
|
'aliases' => [
|
||||||
|
|||||||
16
config/vacentral.php
Normal file
16
config/vacentral.php
Normal 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',
|
||||||
|
];
|
||||||
@@ -19,8 +19,6 @@ return [
|
|||||||
|
|
||||||
# overrides phpvms.php
|
# overrides phpvms.php
|
||||||
'phpvms' => [
|
'phpvms' => [
|
||||||
'vacentral_api_key' => '',
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ISO "Currency Code" to use, the list is in config/money.php
|
* The ISO "Currency Code" to use, the list is in config/money.php
|
||||||
*
|
*
|
||||||
@@ -35,6 +33,10 @@ return [
|
|||||||
'default' => 'default',
|
'default' => 'default',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'vacentral' => [
|
||||||
|
'api_key' => '',
|
||||||
|
],
|
||||||
|
|
||||||
# overrides cache.php
|
# overrides cache.php
|
||||||
'cache' => [
|
'cache' => [
|
||||||
'default' => '$CACHE_DRIVER$',
|
'default' => '$CACHE_DRIVER$',
|
||||||
|
|||||||
Reference in New Issue
Block a user