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
345db88b
Commit
345db88b
authored
Nov 18, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for the primary menu for setting the public routes
parent
481b0447
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
EloquentMenuItemRepository.php
Repositories/Eloquent/EloquentMenuItemRepository.php
+12
-3
No files found.
Repositories/Eloquent/EloquentMenuItemRepository.php
View file @
345db88b
...
@@ -47,18 +47,27 @@ class EloquentMenuItemRepository extends EloquentBaseRepository implements MenuI
...
@@ -47,18 +47,27 @@ class EloquentMenuItemRepository extends EloquentBaseRepository implements MenuI
*/
*/
public
function
getForRoutes
()
public
function
getForRoutes
()
{
{
$menuitems
=
DB
::
table
(
'menuitems'
)
$menuitems
=
DB
::
table
(
'menus'
)
->
select
(
'menuitems.id'
,
'menuitems.parent_id'
,
'uri'
,
'locale'
,
'module_name'
)
->
select
(
'primary'
,
'menuitems.id'
,
'menuitems.parent_id'
,
'menuitems.module_name'
,
'menuitem_translations.uri'
,
'menuitem_translations.locale'
)
->
join
(
'menuitems'
,
'menus.id'
,
'='
,
'menuitems.menu_id'
)
->
join
(
'menuitem_translations'
,
'menuitems.id'
,
'='
,
'menuitem_translations.menuitem_id'
)
->
join
(
'menuitem_translations'
,
'menuitems.id'
,
'='
,
'menuitem_translations.menuitem_id'
)
->
where
(
'uri'
,
'!='
,
''
)
->
where
(
'uri'
,
'!='
,
''
)
->
where
(
'module_name'
,
'!='
,
''
)
->
where
(
'module_name'
,
'!='
,
''
)
->
where
(
'status'
,
'='
,
1
)
->
where
(
'status'
,
'='
,
1
)
->
where
(
'primary'
,
'='
,
1
)
->
orderBy
(
'module_name'
)
->
orderBy
(
'module_name'
)
->
get
();
->
get
();
$menuitemsArray
=
[];
$menuitemsArray
=
[];
foreach
(
$menuitems
as
$menuitem
)
{
foreach
(
$menuitems
as
$menuitem
)
{
$menuitemsArray
[
$menuitem
->
module_name
][
$menuitem
->
locale
]
=
$menuitem
->
locale
.
'/'
.
$menuitem
->
uri
;
$menuitemsArray
[
$menuitem
->
module_name
][
$menuitem
->
locale
]
=
$menuitem
->
locale
.
'/'
.
$menuitem
->
uri
;
}
}
return
$menuitemsArray
;
return
$menuitemsArray
;
...
...
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