Making existing sidebar event listeners to use the abstract sidebar class remove duplicate logic

parent 2bcf8096
...@@ -5,32 +5,10 @@ namespace Modules\Dashboard\Events\Handlers; ...@@ -5,32 +5,10 @@ namespace Modules\Dashboard\Events\Handlers;
use Maatwebsite\Sidebar\Group; use Maatwebsite\Sidebar\Group;
use Maatwebsite\Sidebar\Item; use Maatwebsite\Sidebar\Item;
use Maatwebsite\Sidebar\Menu; use Maatwebsite\Sidebar\Menu;
use Maatwebsite\Sidebar\SidebarExtender; use Modules\Core\Sidebar\AbstractAdminSidebar;
use Modules\Core\Events\BuildingSidebar;
use Modules\User\Contracts\Authentication;
class RegisterDashboardSidebar implements SidebarExtender class RegisterDashboardSidebar extends AbstractAdminSidebar
{ {
/**
* @var Authentication
*/
protected $auth;
/**
* @param Authentication $auth
*
* @internal param Guard $guard
*/
public function __construct(Authentication $auth)
{
$this->auth = $auth;
}
public function handle(BuildingSidebar $sidebar)
{
$sidebar->add($this->extendWith($sidebar->getMenu()));
}
/** /**
* @param Menu $menu * @param Menu $menu
* @return Menu * @return Menu
......
...@@ -5,32 +5,10 @@ namespace Modules\Page\Events\Handlers; ...@@ -5,32 +5,10 @@ namespace Modules\Page\Events\Handlers;
use Maatwebsite\Sidebar\Group; use Maatwebsite\Sidebar\Group;
use Maatwebsite\Sidebar\Item; use Maatwebsite\Sidebar\Item;
use Maatwebsite\Sidebar\Menu; use Maatwebsite\Sidebar\Menu;
use Maatwebsite\Sidebar\SidebarExtender; use Modules\Core\Sidebar\AbstractAdminSidebar;
use Modules\Core\Events\BuildingSidebar;
use Modules\User\Contracts\Authentication;
class RegisterPageSidebar implements SidebarExtender class RegisterPageSidebar extends AbstractAdminSidebar
{ {
/**
* @var Authentication
*/
protected $auth;
/**
* @param Authentication $auth
*
* @internal param Guard $guard
*/
public function __construct(Authentication $auth)
{
$this->auth = $auth;
}
public function handle(BuildingSidebar $sidebar)
{
$sidebar->add($this->extendWith($sidebar->getMenu()));
}
/** /**
* @param Menu $menu * @param Menu $menu
* @return Menu * @return Menu
......
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