Skip to content

Commit a916029

Browse files
committed
Some cleaning
1 parent 03748e4 commit a916029

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

src/Composers/SidebarViewComposer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace TypiCMS\Modules\Places\Composers;
44

5-
use Illuminate\Contracts\View\View;
65
use Illuminate\Support\Facades\Gate;
6+
use Illuminate\View\View;
77
use Maatwebsite\Sidebar\SidebarGroup;
88
use Maatwebsite\Sidebar\SidebarItem;
99

src/Providers/ModuleServiceProvider.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace TypiCMS\Modules\Places\Providers;
44

55
use Illuminate\Foundation\AliasLoader;
6+
use Illuminate\Support\Facades\View;
67
use Illuminate\Support\ServiceProvider;
78
use TypiCMS\Modules\Core\Facades\TypiCMS;
89
use TypiCMS\Modules\Core\Observers\SlugObserver;
@@ -12,13 +13,12 @@
1213

1314
class 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
}

src/Providers/RouteServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class RouteServiceProvider extends ServiceProvider
1414
{
15-
public function map()
15+
public function map(): void
1616
{
1717
/*
1818
* Front office routes

0 commit comments

Comments
 (0)