1
|
|
|
<?php namespace Arcanedev\Settings; |
2
|
|
|
|
3
|
|
|
use Arcanedev\Support\PackageServiceProvider as ServiceProvider; |
4
|
|
|
use Illuminate\Foundation\Application; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* Class SettingsServiceProvider |
8
|
|
|
* |
9
|
|
|
* @package Arcanedev\Settings |
10
|
|
|
* @author ARCANEDEV <[email protected]> |
11
|
|
|
*/ |
12
|
|
|
class SettingsServiceProvider extends ServiceProvider |
13
|
|
|
{ |
14
|
|
|
/* ------------------------------------------------------------------------------------------------ |
15
|
|
|
| Properties |
16
|
|
|
| ------------------------------------------------------------------------------------------------ |
17
|
|
|
*/ |
18
|
|
|
/** |
19
|
|
|
* Vendor name. |
20
|
|
|
* |
21
|
|
|
* @var string |
22
|
|
|
*/ |
23
|
|
|
protected $vendor = 'arcanedev'; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Package name. |
27
|
|
|
* |
28
|
|
|
* @var string |
29
|
|
|
*/ |
30
|
|
|
protected $package = 'settings'; |
31
|
|
|
|
32
|
|
|
/* ------------------------------------------------------------------------------------------------ |
33
|
|
|
| Getters & Setters |
34
|
|
|
| ------------------------------------------------------------------------------------------------ |
35
|
|
|
*/ |
36
|
|
|
/** |
37
|
|
|
* Get the base path of the package. |
38
|
|
|
* |
39
|
|
|
* @return string |
40
|
|
|
*/ |
41
|
87 |
|
public function getBasePath() |
42
|
|
|
{ |
43
|
87 |
|
return dirname(__DIR__); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/* ------------------------------------------------------------------------------------------------ |
47
|
|
|
| Main Functions |
48
|
|
|
| ------------------------------------------------------------------------------------------------ |
49
|
|
|
*/ |
50
|
|
|
/** |
51
|
|
|
* Register the service provider. |
52
|
|
|
*/ |
53
|
87 |
|
public function register() |
54
|
|
|
{ |
55
|
87 |
|
$this->registerConfig(); |
56
|
|
|
|
57
|
|
|
$this->singleton('arcanedev.settings.manager', function($app) { |
58
|
|
|
return new SettingsManager($app); |
59
|
87 |
|
}); |
60
|
|
|
|
61
|
87 |
|
$this->app->bind('arcanedev.settings.store', function(Application $app) { |
62
|
|
|
return $app->make('arcanedev.settings.manager')->driver(); |
63
|
87 |
|
}); |
64
|
87 |
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* Boot the service provider. |
68
|
|
|
*/ |
69
|
87 |
|
public function boot() |
70
|
|
|
{ |
71
|
87 |
|
parent::boot(); |
72
|
87 |
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* Get the services provided by the provider. |
76
|
|
|
* |
77
|
|
|
* @return array |
78
|
|
|
*/ |
79
|
3 |
|
public function provides() |
80
|
|
|
{ |
81
|
|
|
return [ |
82
|
3 |
|
'arcanedev.settings.manager', |
83
|
3 |
|
'arcanedev.settings.store', |
84
|
3 |
|
]; |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|