Skip to content

Commit

Permalink
Some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Nov 9, 2021
1 parent 1a9ad46 commit f1a6074
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Composers/SidebarViewComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace TypiCMS\Modules\Partners\Composers;

use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Gate;
use Illuminate\View\View;
use Maatwebsite\Sidebar\SidebarGroup;
use Maatwebsite\Sidebar\SidebarItem;

Expand Down
24 changes: 8 additions & 16 deletions src/Providers/ModuleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace TypiCMS\Modules\Partners\Providers;

use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use TypiCMS\Modules\Core\Facades\TypiCMS;
use TypiCMS\Modules\Core\Observers\SlugObserver;
Expand All @@ -12,13 +13,12 @@

class ModuleServiceProvider extends ServiceProvider
{
public function boot()
public function boot(): void
{
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'typicms.partners');
$this->mergeConfigFrom(__DIR__.'/../config/permissions.php', 'typicms.permissions');

$modules = $this->app['config']['typicms']['modules'];
$this->app['config']->set('typicms.modules', array_merge(['partners' => ['linkable_to_page']], $modules));
config(['typicms.modules.partners' => ['linkable_to_page']]);

$this->loadViewsFrom(__DIR__.'/../../resources/views/', 'partners');

Expand All @@ -39,28 +39,20 @@ public function boot()
// Observers
Partner::observe(new SlugObserver());

/*
* Sidebar view composer
*/
$this->app->view->composer('core::admin._sidebar', SidebarViewComposer::class);
View::composer('core::admin._sidebar', SidebarViewComposer::class);

/*
* Add the page in the view.
*/
$this->app->view->composer('partners::public.*', function ($view) {
View::composer('partners::public.*', function ($view) {
$view->page = TypiCMS::getPageLinkedToModule('partners');
});
}

public function register()
public function register(): void
{
$app = $this->app;

/*
* Register route service provider
*/
$app->register(RouteServiceProvider::class);
$this->app->register(RouteServiceProvider::class);

$app->bind('Partners', Partner::class);
$this->app->bind('Partners', Partner::class);
}
}
2 changes: 1 addition & 1 deletion src/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class RouteServiceProvider extends ServiceProvider
{
public function map()
public function map(): void
{
/*
* Front office routes
Expand Down

0 comments on commit f1a6074

Please sign in to comment.