File tree Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Expand file tree Collapse file tree 2 files changed +27
-5
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace DLP ;
4+
5+ use Encore \Admin \Extension ;
6+
7+ class DLP extends Extension
8+ {
9+ public $ name = 'dlp ' ;
10+
11+ public $ views = __DIR__ .'/../resources/views ' ;
12+
13+ public $ assets = __DIR__ .'/../resources/assets ' ;
14+ }
Original file line number Diff line number Diff line change 1212
1313class DLPServiceProvider extends ServiceProvider
1414{
15- public function boot ()
15+ public function boot (DLP $ extension )
1616 {
17- $ this ->loadViewsFrom (__DIR__ .'/../resources/views ' , 'dlp ' );
17+ if (!DLP ::boot ()) {
18+ return ;
19+ }
1820
19- $ this ->publishes ([
20- __DIR__ .'/../resources/assets ' => public_path ('vendor/dlp/ ' )
21- ]);
21+ if ($ views = $ extension ->views ()) {
22+ $ this ->loadViewsFrom (__DIR__ .'/../resources/views ' , 'dlp ' );
23+ }
24+
25+ if ($ this ->app ->runningInConsole () && $ assets = $ extension ->assets ()) {
26+ $ this ->publishes ([
27+ __DIR__ .'/../resources/assets ' => public_path ('vendor/dlp/ ' )
28+ ]);
29+ }
2230
2331 Admin::booting (function () {
2432 Admin::css ('vendor/dlp/component.min.css?v3.4 ' );
You can’t perform that action at this time.
0 commit comments