Trigger the new BuildingSidebar hook

parent c26a7506
...@@ -7,6 +7,7 @@ use Maatwebsite\Sidebar\Menu; ...@@ -7,6 +7,7 @@ use Maatwebsite\Sidebar\Menu;
use Maatwebsite\Sidebar\ShouldCache; use Maatwebsite\Sidebar\ShouldCache;
use Maatwebsite\Sidebar\Sidebar; use Maatwebsite\Sidebar\Sidebar;
use Maatwebsite\Sidebar\Traits\CacheableTrait; use Maatwebsite\Sidebar\Traits\CacheableTrait;
use Modules\Core\Events\BuildingSidebar;
use Nwidart\Modules\Contracts\RepositoryInterface; use Nwidart\Modules\Contracts\RepositoryInterface;
class AdminSidebar implements Sidebar, ShouldCache class AdminSidebar implements Sidebar, ShouldCache
...@@ -44,6 +45,8 @@ class AdminSidebar implements Sidebar, ShouldCache ...@@ -44,6 +45,8 @@ class AdminSidebar implements Sidebar, ShouldCache
*/ */
public function build() public function build()
{ {
event($event = new BuildingSidebar($this->menu));
foreach ($this->modules->enabled() as $module) { foreach ($this->modules->enabled() as $module) {
$lowercaseModule = strtolower($module->get('name')); $lowercaseModule = strtolower($module->get('name'));
if ($this->hasCustomSidebar($lowercaseModule) === true) { if ($this->hasCustomSidebar($lowercaseModule) === true) {
......
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