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 bed2fff commit 2e5c274
Show file tree
Hide file tree
Showing 3 changed files with 8 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\Roles\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
22 changes: 6 additions & 16 deletions src/Providers/ModuleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@
namespace TypiCMS\Modules\Roles\Providers;

use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use TypiCMS\Modules\Roles\Facades\Roles;
use TypiCMS\Modules\Roles\Models\Role;

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

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

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

$this->publishes([
Expand All @@ -31,21 +29,13 @@ public function boot()

AliasLoader::getInstance()->alias('Roles', Roles::class);

/*
* Sidebar view composer
*/
$this->app->view->composer('core::admin._sidebar', \TypiCMS\Modules\Roles\Composers\SidebarViewComposer::class);
View::composer('core::admin._sidebar', \TypiCMS\Modules\Roles\Composers\SidebarViewComposer::class);
}

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

/*
* Register route service provider
*/
$app->register(\TypiCMS\Modules\Roles\Providers\RouteServiceProvider::class);
$this->app->register(\TypiCMS\Modules\Roles\Providers\RouteServiceProvider::class);

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

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

0 comments on commit 2e5c274

Please sign in to comment.