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 +58
-2
lines changed Expand file tree Collapse file tree 2 files changed +58
-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 avilable on when env('APP_DEBUG') is true.
10
+ | If you set this value to "true" it will be always accessable even on
11
+ | production environment.
12
+ |
13
+ */
14
+ 'dashboard ' => null ,
15
+
16
+ /*
17
+ |--------------------------------------------------------------------------
18
+ | Microservice
19
+ |--------------------------------------------------------------------------
20
+ |
21
+ | By default Lucid Architecture is setup as microservice. Microservice
22
+ | means that you will have only one service and all features / jobs / data
23
+ | etc. will be generated into /app/ directory.
24
+ |
25
+ | When you set this value to "false" it means you application have multiple
26
+ | services and all classes will be generated into /src/ directrory. After
27
+ | changing that value all "lucid" classes should be moved from /app/ to
28
+ | /src/.
29
+ */
30
+ //'microservice' => true,
31
+
32
+ ];
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
+ $ dashboard_enabled = $ this ->app ['config ' ]->get ('lucid.dashboard ' );
31
+
32
+ if ($ dashboard_enabled === null ) {
33
+ $ dashboard_enabled = $ this ->app ['config ' ]->get ('app.debug ' );
34
+ }
35
+
36
+ if ($ dashboard_enabled === 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