Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
9d8cdf71
Commit
9d8cdf71
authored
Nov 19, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get the roots only for the given menu id
parent
3bb7d888
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
MenuController.php
Http/Controllers/Admin/MenuController.php
+1
-1
EloquentMenuItemRepository.php
Repositories/Eloquent/EloquentMenuItemRepository.php
+2
-2
MenuItemRepository.php
Repositories/MenuItemRepository.php
+1
-1
No files found.
Http/Controllers/Admin/MenuController.php
View file @
9d8cdf71
...
...
@@ -65,7 +65,7 @@ class MenuController extends AdminBaseController
public
function
edit
(
Menu
$menu
)
{
$menuItems
=
$this
->
menuItem
->
roots
(
);
$menuItems
=
$this
->
menuItem
->
roots
ForMenu
(
$menu
->
id
);
$menuStructure
=
$this
->
menuRenderer
->
renderForMenu
(
$menu
->
id
,
$menuItems
);
...
...
Repositories/Eloquent/EloquentMenuItemRepository.php
View file @
9d8cdf71
...
...
@@ -20,9 +20,9 @@ class EloquentMenuItemRepository extends EloquentBaseRepository implements MenuI
return
$menuItem
;
}
public
function
roots
(
)
public
function
roots
ForMenu
(
$menuId
)
{
return
$this
->
model
->
roots
()
->
orderBy
(
'position'
)
->
get
();
return
$this
->
model
->
roots
()
->
where
(
'menu_id'
,
$menuId
)
->
orderBy
(
'position'
)
->
get
();
}
/**
...
...
Repositories/MenuItemRepository.php
View file @
9d8cdf71
...
...
@@ -8,7 +8,7 @@ interface MenuItemRepository extends BaseRepository
* Get all root elements
* @return mixed
*/
public
function
roots
(
);
public
function
roots
ForMenu
(
$menuId
);
/**
* Get the menu items ready for routes
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment