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 16cf0b2 commit a08b88e
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\Files\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,6 +3,7 @@
namespace TypiCMS\Modules\Files\Providers;

use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use TypiCMS\Modules\Core\Services\FileUploader;
use TypiCMS\Modules\Files\Composers\SidebarViewComposer;
Expand All @@ -12,14 +13,11 @@

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

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

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

$this->publishes([
Expand All @@ -36,21 +34,13 @@ public function boot()
// Observers
File::observe(new FileObserver(new FileUploader()));

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

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('Files', File::class);
$this->app->bind('Files', File::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 a08b88e

Please sign in to comment.