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 12
12
13
13
class DLPServiceProvider extends ServiceProvider
14
14
{
15
- public function boot ()
15
+ public function boot (DLP $ extension )
16
16
{
17
- $ this ->loadViewsFrom (__DIR__ .'/../resources/views ' , 'dlp ' );
17
+ if (!DLP ::boot ()) {
18
+ return ;
19
+ }
18
20
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
+ }
22
30
23
31
Admin::booting (function () {
24
32
Admin::css ('vendor/dlp/component.min.css?v3.4 ' );
You can’t perform that action at this time.
0 commit comments