Renaming event handler

parent 4eb370fc
...@@ -8,7 +8,7 @@ use Maatwebsite\Sidebar\Menu; ...@@ -8,7 +8,7 @@ use Maatwebsite\Sidebar\Menu;
use Modules\Core\Events\BuildingSidebar; use Modules\Core\Events\BuildingSidebar;
use Modules\User\Contracts\Authentication; use Modules\User\Contracts\Authentication;
class AddPageSidebar implements \Maatwebsite\Sidebar\SidebarExtender class RegisterPageSidebar implements \Maatwebsite\Sidebar\SidebarExtender
{ {
/** /**
* @var Authentication * @var Authentication
...@@ -27,9 +27,7 @@ class AddPageSidebar implements \Maatwebsite\Sidebar\SidebarExtender ...@@ -27,9 +27,7 @@ class AddPageSidebar implements \Maatwebsite\Sidebar\SidebarExtender
public function handle(BuildingSidebar $sidebar) public function handle(BuildingSidebar $sidebar)
{ {
$menu = $sidebar->getMenu(); $sidebar->add($this->extendWith($sidebar->getMenu()));
$menu1 = $this->extendWith($menu);
$sidebar->add($menu1);
} }
/** /**
......
...@@ -9,7 +9,7 @@ use Modules\Core\Events\CollectingAssets; ...@@ -9,7 +9,7 @@ use Modules\Core\Events\CollectingAssets;
use Modules\Core\Traits\CanGetSidebarClassForModule; use Modules\Core\Traits\CanGetSidebarClassForModule;
use Modules\Core\Traits\CanPublishConfiguration; use Modules\Core\Traits\CanPublishConfiguration;
use Modules\Page\Entities\Page; use Modules\Page\Entities\Page;
use Modules\Page\Events\Handlers\AddPageSidebar; use Modules\Page\Events\Handlers\RegisterPageSidebar;
use Modules\Page\Repositories\Cache\CachePageDecorator; use Modules\Page\Repositories\Cache\CachePageDecorator;
use Modules\Page\Repositories\Eloquent\EloquentPageRepository; use Modules\Page\Repositories\Eloquent\EloquentPageRepository;
use Modules\Page\Repositories\PageRepository; use Modules\Page\Repositories\PageRepository;
...@@ -37,8 +37,9 @@ class PageServiceProvider extends ServiceProvider ...@@ -37,8 +37,9 @@ class PageServiceProvider extends ServiceProvider
$this->app['events']->listen( $this->app['events']->listen(
BuildingSidebar::class, BuildingSidebar::class,
$this->getSidebarClassForModule('page', AddPageSidebar::class) $this->getSidebarClassForModule('page', RegisterPageSidebar::class)
); );
$this->app['events']->listen(BuildingSidebar::class, RegisterPageSidebar::class);
} }
public function boot() public function boot()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment