44
55use Illuminate \Foundation \AliasLoader ;
66use Illuminate \Support \Facades \Blade ;
7+ use Illuminate \Support \Facades \View ;
78use Illuminate \Support \ServiceProvider ;
89use TypiCMS \Modules \Blocks \Composers \SidebarViewComposer ;
910use TypiCMS \Modules \Blocks \Facades \Blocks ;
1011use TypiCMS \Modules \Blocks \Models \Block ;
1112
1213class ModuleServiceProvider extends ServiceProvider
1314{
14- public function boot ()
15+ public function boot (): void
1516 {
1617 $ this ->mergeConfigFrom (__DIR__ .'/../config/config.php ' , 'typicms.blocks ' );
1718 $ this ->mergeConfigFrom (__DIR__ .'/../config/permissions.php ' , 'typicms.permissions ' );
1819
19- $ modules = $ this ->app ['config ' ]['typicms ' ]['modules ' ];
20- $ this ->app ['config ' ]->set ('typicms.modules ' , array_merge (['blocks ' => []], $ modules ));
21-
2220 $ this ->loadViewsFrom (__DIR__ .'/../../resources/views/ ' , 'blocks ' );
2321
2422 $ this ->publishes ([
@@ -35,21 +33,13 @@ public function boot()
3533 return "<?php echo Blocks::render( {$ name }) ?> " ;
3634 });
3735
38- /*
39- * Sidebar view composer
40- */
41- $ this ->app ->view ->composer ('core::admin._sidebar ' , SidebarViewComposer::class);
36+ View::composer ('core::admin._sidebar ' , SidebarViewComposer::class);
4237 }
4338
44- public function register ()
39+ public function register (): void
4540 {
46- $ app = $ this ->app ;
47-
48- /*
49- * Register route service provider
50- */
51- $ app ->register (RouteServiceProvider::class);
41+ $ this ->app ->register (RouteServiceProvider::class);
5242
53- $ app ->bind ('Blocks ' , Block::class);
43+ $ this -> app ->bind ('Blocks ' , Block::class);
5444 }
5545}
0 commit comments