Skip to content

Commit

Permalink
Remove empty groups from sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Morales committed Jul 21, 2016
1 parent 9125663 commit 05033eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Abstractor/Eloquent/FieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class FieldFactory implements FieldAbstractorFactoryContract
'password',
'hidden',
'select',
'file'
'file',
'money'
);

public function __construct(FormManagerFactory $factory)
Expand Down
4 changes: 4 additions & 0 deletions src/View/Composers/SidebarComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ private function getSidebarItems()
continue;
}
}
// Remove empty groups (resulting, most probably, of different permissions)
if(count($menuItems[$group]['items']) < 1) {
unset($menuItems[$group]);
}
}
}

Expand Down

0 comments on commit 05033eb

Please sign in to comment.