Skip to content

Commit

Permalink
display module settings menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Nov 1, 2017
1 parent 86cb525 commit fbc7b78
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Http/Middleware/AdminMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

namespace App\Http\Middleware;

use App\Models\Module\Module;
use App\Events\AdminMenuCreated;
use Auth;
use Closure;
use Menu;
use Module;
use Module as LaravelModule;

class AdminMenu
{
Expand Down Expand Up @@ -152,12 +153,14 @@ public function handle($request, Closure $next)
$modules = Module::all();
$position = 5;
foreach ($modules as $module) {
$m = LaravelModule::findByAlias($module->alias);

// Check if the module has settings
if (empty($module->get('settings'))) {
if (empty($m->get('settings'))) {
continue;
}

$sub->url('settings/modules/' . $module->getAlias(), $module->getName(), $position, $attr);
$sub->url('settings/modules/' . $m->getAlias(), $m->getName(), $position, $attr);

$position++;
}
Expand Down

0 comments on commit fbc7b78

Please sign in to comment.