1 | <?php namespace Arcanedev\Support\Providers; |
||
16 | abstract class PackageServiceProvider extends ServiceProvider |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Traits |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | use HasConfig, |
||
24 | HasFactories, |
||
25 | HasMigrations, |
||
26 | HasTranslations, |
||
27 | HasViews; |
||
28 | |||
29 | /* ----------------------------------------------------------------- |
||
30 | | Properties |
||
31 | | ----------------------------------------------------------------- |
||
32 | */ |
||
33 | |||
34 | /** |
||
35 | * Vendor name. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $vendor = 'arcanedev'; |
||
40 | |||
41 | /** |
||
42 | * Package name. |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $package = ''; |
||
47 | |||
48 | /** |
||
49 | * Package base path. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $basePath; |
||
54 | |||
55 | /* ----------------------------------------------------------------- |
||
56 | | Constructor |
||
57 | | ----------------------------------------------------------------- |
||
58 | */ |
||
59 | |||
60 | /** |
||
61 | * Create a new service provider instance. |
||
62 | * |
||
63 | * @param \Illuminate\Contracts\Foundation\Application $app |
||
64 | */ |
||
65 | 6 | public function __construct(Application $app) |
|
71 | |||
72 | /** |
||
73 | * Resolve the base path of the package. |
||
74 | * |
||
75 | * @return string |
||
76 | */ |
||
77 | 6 | protected function resolveBasePath() |
|
83 | |||
84 | /* ----------------------------------------------------------------- |
||
85 | | Getters & Setters |
||
86 | | ----------------------------------------------------------------- |
||
87 | */ |
||
88 | |||
89 | /** |
||
90 | * Get the base path of the package. |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | 6 | public function getBasePath() |
|
98 | |||
99 | /** |
||
100 | * Get the base database path. |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | protected function getDatabasePath() |
||
108 | |||
109 | /** |
||
110 | * Get the base resources path. |
||
111 | * |
||
112 | * @deprecated Use the getBasePath() instead! |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | protected function getResourcesPath() |
||
120 | |||
121 | /* ----------------------------------------------------------------- |
||
122 | | Main Methods |
||
123 | | ----------------------------------------------------------------- |
||
124 | */ |
||
125 | |||
126 | /** |
||
127 | * Register the service provider. |
||
128 | */ |
||
129 | 6 | public function register() |
|
135 | |||
136 | /* ----------------------------------------------------------------- |
||
137 | | Package Methods |
||
138 | | ----------------------------------------------------------------- |
||
139 | */ |
||
140 | |||
141 | /** |
||
142 | * Publish all the package files. |
||
143 | * |
||
144 | * @param bool $load |
||
145 | */ |
||
146 | protected function publishAll($load = true) |
||
154 | |||
155 | /* ------------------------------------------------------------------------------------------------ |
||
156 | | Check Functions |
||
157 | | ------------------------------------------------------------------------------------------------ |
||
158 | */ |
||
159 | |||
160 | /** |
||
161 | * Check package name. |
||
162 | * |
||
163 | * @throws \Arcanedev\Support\Exceptions\PackageException |
||
164 | */ |
||
165 | 6 | private function checkPackageName() |
|
170 | } |
||
171 |