This repository was archived by the owner on Apr 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Expand file tree Collapse file tree 2 files changed +41
-2
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ return [
4
+ /*
5
+ |--------------------------------------------------------------------------
6
+ | Dashboard
7
+ |--------------------------------------------------------------------------
8
+ |
9
+ | By default /lucid/dashboard is available when env('APP_DEBUG') is true.
10
+ | If you set this value to "true" it will be always accessible even on
11
+ | production environment.
12
+ |
13
+ */
14
+ 'dashboard ' => null ,
15
+ ];
Original file line number Diff line number Diff line change @@ -24,8 +24,19 @@ class LucidServiceProvider extends ServiceProvider
24
24
*/
25
25
public function boot ()
26
26
{
27
- if (!$ this ->app ->routesAreCached ()) {
28
- require_once __DIR__ .'/Http/routes.php ' ;
27
+ $ configPath = __DIR__ . '/../config/lucid.php ' ;
28
+ $ this ->publishes ([$ configPath => $ this ->getConfigPath ()], 'config ' );
29
+
30
+ $ dashboardEnabled = $ this ->app ['config ' ]->get ('lucid.dashboard ' );
31
+
32
+ if ($ dashboardEnabled === null ) {
33
+ $ dashboardEnabled = $ this ->app ['config ' ]->get ('app.debug ' );
34
+ }
35
+
36
+ if ($ dashboardEnabled === true ) {
37
+ if (!$ this ->app ->routesAreCached () ) {
38
+ require_once __DIR__ .'/Http/routes.php ' ;
39
+ }
29
40
}
30
41
31
42
$ this ->loadViewsFrom (__DIR__ .'/../resources/views ' , 'lucid ' );
@@ -40,6 +51,19 @@ public function boot()
40
51
*/
41
52
public function register ()
42
53
{
54
+ $ configPath = __DIR__ . '/../config/lucid.php ' ;
55
+ $ this ->mergeConfigFrom ($ configPath , 'lucid ' );
56
+
43
57
$ this ->app ->register (LogReaderServiceProvider::class);
44
58
}
59
+
60
+ /**
61
+ * Return path to config file.
62
+ *
63
+ * @return string
64
+ */
65
+ private function getConfigPath ()
66
+ {
67
+ return config_path ('lucid.php ' );
68
+ }
45
69
}
You can’t perform that action at this time.
0 commit comments