33namespace TypiCMS \Modules \Places \Providers ;
44
55use Illuminate \Foundation \AliasLoader ;
6+ use Illuminate \Support \Facades \View ;
67use Illuminate \Support \ServiceProvider ;
78use TypiCMS \Modules \Core \Facades \TypiCMS ;
89use TypiCMS \Modules \Core \Observers \SlugObserver ;
1213
1314class ModuleServiceProvider extends ServiceProvider
1415{
15- public function boot ()
16+ public function boot (): void
1617 {
1718 $ this ->mergeConfigFrom (__DIR__ .'/../config/config.php ' , 'typicms.places ' );
1819 $ this ->mergeConfigFrom (__DIR__ .'/../config/permissions.php ' , 'typicms.permissions ' );
1920
20- $ modules = $ this ->app ['config ' ]['typicms ' ]['modules ' ];
21- $ this ->app ['config ' ]->set ('typicms.modules ' , array_merge (['places ' => ['linkable_to_page ' ]], $ modules ));
21+ config (['typicms.modules.places ' => ['linkable_to_page ' ]]);
2222
2323 $ this ->loadViewsFrom (__DIR__ .'/../../resources/views/ ' , 'places ' );
2424
@@ -43,28 +43,20 @@ public function boot()
4343 // Observers
4444 Place::observe (new SlugObserver ());
4545
46- /*
47- * Sidebar view composer
48- */
49- $ this ->app ->view ->composer ('core::admin._sidebar ' , SidebarViewComposer::class);
46+ View::composer ('core::admin._sidebar ' , SidebarViewComposer::class);
5047
5148 /*
5249 * Add the page in the view.
5350 */
54- $ this -> app -> view -> composer ('places::public.* ' , function ($ view ) {
51+ View:: composer ('places::public.* ' , function ($ view ) {
5552 $ view ->page = TypiCMS::getPageLinkedToModule ('places ' );
5653 });
5754 }
5855
59- public function register ()
56+ public function register (): void
6057 {
61- $ app = $ this ->app ;
62-
63- /*
64- * Register route service provider
65- */
66- $ app ->register (RouteServiceProvider::class);
58+ $ this ->app ->register (RouteServiceProvider::class);
6759
68- $ app ->bind ('Places ' , Place::class);
60+ $ this -> app ->bind ('Places ' , Place::class);
6961 }
7062}
0 commit comments