@@ -31,43 +31,9 @@ public function boot()
31
31
// load config
32
32
Config::load ();
33
33
34
- // replace early boot logging redirect log to config location, unless APP_LOG is set
35
- Log::getMonolog ()->popHandler (); // remove existing errorlog logger
36
- Log::useFiles (config ('app.log ' ) ?: Config::get ('log_file ' , base_path ('logs/librenms.log ' )), 'error ' );
37
-
38
- // Blade directives (Yucky because of < L5.5)
39
- Blade::directive ('config ' , function ($ key ) {
40
- return "<?php if (\LibreNMS\Config::get(( $ key))): ?> " ;
41
- });
42
- Blade::directive ('notconfig ' , function ($ key ) {
43
- return "<?php if (!\LibreNMS\Config::get(( $ key))): ?> " ;
44
- });
45
- Blade::directive ('endconfig ' , function () {
46
- return "<?php endif; ?> " ;
47
- });
48
- Blade::directive ('admin ' , function () {
49
- return "<?php if (auth()->check() && auth()->user()->isAdmin()): ?> " ;
50
- });
51
- Blade::directive ('endadmin ' , function () {
52
- return "<?php endif; ?> " ;
53
- });
54
-
34
+ $ this ->bootCustomBladeDirectives ();
55
35
$ this ->bootCustomValidators ();
56
36
$ this ->configureMorphAliases ();
57
-
58
- // Development service providers
59
- if ($ this ->app ->environment () !== 'production ' ) {
60
- if (class_exists (\Barryvdh \LaravelIdeHelper \IdeHelperServiceProvider::class)) {
61
- $ this ->app ->register (\Barryvdh \LaravelIdeHelper \IdeHelperServiceProvider::class);
62
- }
63
-
64
- if (config ('app.debug ' ) && class_exists (\Barryvdh \Debugbar \ServiceProvider::class)) {
65
- // disable debugbar for api routes
66
- if (!Request::is ('api/* ' )) {
67
- $ this ->app ->register (\Barryvdh \Debugbar \ServiceProvider::class);
68
- }
69
- }
70
- }
71
37
}
72
38
73
39
/**
@@ -80,6 +46,19 @@ public function register()
80
46
$ this ->registerGeocoder ();
81
47
}
82
48
49
+ private function bootCustomBladeDirectives ()
50
+ {
51
+ Blade::if ('config ' , function ($ key ) {
52
+ return \LibreNMS \Config::get ($ key );
53
+ });
54
+ Blade::if ('notconfig ' , function ($ key ) {
55
+ return !\LibreNMS \Config::get ($ key );
56
+ });
57
+ Blade::if ('admin ' , function () {
58
+ return auth ()->check () && auth ()->user ()->isAdmin ();
59
+ });
60
+ }
61
+
83
62
private function configureMorphAliases ()
84
63
{
85
64
Relation::morphMap ([
0 commit comments