1 | <?php |
||
20 | abstract class PackageServiceProvider extends ServiceProvider |
||
21 | { |
||
22 | /* ----------------------------------------------------------------- |
||
23 | | Traits |
||
24 | | ----------------------------------------------------------------- |
||
25 | */ |
||
26 | |||
27 | use HasAssets, |
||
28 | HasConfig, |
||
29 | HasFactories, |
||
30 | HasMigrations, |
||
31 | HasTranslations, |
||
32 | HasViews; |
||
33 | |||
34 | /* ----------------------------------------------------------------- |
||
35 | | Properties |
||
36 | | ----------------------------------------------------------------- |
||
37 | */ |
||
38 | |||
39 | /** |
||
40 | * Vendor name. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $vendor = 'arcanedev'; |
||
45 | |||
46 | /** |
||
47 | * Package name. |
||
48 | * |
||
49 | * @var string|null |
||
50 | */ |
||
51 | protected $package; |
||
52 | |||
53 | /** |
||
54 | * Package base path. |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $basePath; |
||
59 | |||
60 | /* ----------------------------------------------------------------- |
||
61 | | Constructor |
||
62 | | ----------------------------------------------------------------- |
||
63 | */ |
||
64 | |||
65 | /** |
||
66 | * Create a new service provider instance. |
||
67 | * |
||
68 | * @param \Illuminate\Contracts\Foundation\Application $app |
||
69 | */ |
||
70 | 18 | public function __construct(Application $app) |
|
76 | |||
77 | /** |
||
78 | * Resolve the base path of the package. |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | 18 | protected function resolveBasePath() |
|
88 | |||
89 | /* ----------------------------------------------------------------- |
||
90 | | Getters & Setters |
||
91 | | ----------------------------------------------------------------- |
||
92 | */ |
||
93 | |||
94 | /** |
||
95 | * Get the base path of the package. |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 18 | public function getBasePath() |
|
103 | |||
104 | /** |
||
105 | * Get the vendor name. |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | 18 | protected function getVendorName(): string |
|
113 | |||
114 | /** |
||
115 | * Get the package name. |
||
116 | * |
||
117 | * @return string|null |
||
118 | */ |
||
119 | 18 | protected function getPackageName(): ?string |
|
123 | |||
124 | /* ----------------------------------------------------------------- |
||
125 | | Main Methods |
||
126 | | ----------------------------------------------------------------- |
||
127 | */ |
||
128 | |||
129 | /** |
||
130 | * Register the service provider. |
||
131 | */ |
||
132 | 18 | public function register() |
|
138 | |||
139 | /* ----------------------------------------------------------------- |
||
140 | | Package Methods |
||
141 | | ----------------------------------------------------------------- |
||
142 | */ |
||
143 | |||
144 | /** |
||
145 | * Publish all the package files. |
||
146 | */ |
||
147 | protected function publishAll(): void |
||
156 | |||
157 | /* ----------------------------------------------------------------- |
||
158 | | Check Methods |
||
159 | | ----------------------------------------------------------------- |
||
160 | */ |
||
161 | |||
162 | /** |
||
163 | * Check package name. |
||
164 | * |
||
165 | * @throws \Arcanedev\Support\Exceptions\PackageException |
||
166 | */ |
||
167 | 18 | protected function checkPackageName(): void |
|
173 | |||
174 | /* ----------------------------------------------------------------- |
||
175 | | Other Methods |
||
176 | | ----------------------------------------------------------------- |
||
177 | */ |
||
178 | |||
179 | /** |
||
180 | * Get the published tags. |
||
181 | * |
||
182 | * @param string $tag |
||
183 | * |
||
184 | * @return array |
||
185 | */ |
||
186 | protected function getPublishedTags(string $tag): array |
||
194 | } |
||
195 |