forked from flutterbest/easytbk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathServiceProvider.php
46 lines (40 loc) · 1.03 KB
/
ServiceProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace NiuGengYun\EasyTBK;
use Illuminate\Foundation\Application as LaravelApplication;
use Laravel\Lumen\Application as LumenApplication;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
class ServiceProvider extends LaravelServiceProvider
{
/**
* Boot the service provider.
*
* @return void
*/
public function boot()
{
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->setupConfig ();
}
/**
* Setup the config.
*
* @return void
*/
protected function setupConfig()
{
$source = realpath (__DIR__ . '/config.php');
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole ()) {
$this->publishes ([$source => config_path ('easytbk.php')]);
} elseif ($this->app instanceof LumenApplication) {
$this->app->configure ('easytbk');
}
$this->mergeConfigFrom ($source, 'easytbk');
}
}