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
d544f14e
Commit
d544f14e
authored
Nov 08, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correcting editing links
parent
930ad2c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
MenuController.php
Http/Controllers/Admin/MenuController.php
+14
-3
index.blade.php
Resources/views/admin/menus/index.blade.php
+4
-4
No files found.
Http/Controllers/Admin/MenuController.php
View file @
d544f14e
<?php
namespace
Modules\Menu\Http\Controllers\Admin
;
use
Illuminate\
Support\Facades\Redirec
t
;
use
Illuminate\
Http\Reques
t
;
use
Illuminate\Support\Facades\View
;
use
Laracasts\Flash\Flash
;
use
Modules\Core\Http\Controllers\Admin\AdminBaseController
;
use
Modules\Menu\Entities\Menu
;
use
Modules\Menu\Http\Requests\CreateMenuRequest
;
use
Modules\Menu\Repositories\MenuRepository
;
...
...
@@ -13,11 +14,16 @@ class MenuController extends AdminBaseController
* @var MenuRepository
*/
private
$menu
;
/**
* @var Request
*/
private
$request
;
public
function
__construct
(
MenuRepository
$menu
)
public
function
__construct
(
MenuRepository
$menu
,
Request
$request
)
{
parent
::
__construct
();
$this
->
menu
=
$menu
;
$this
->
request
=
$request
;
}
public
function
index
()
...
...
@@ -37,6 +43,11 @@ class MenuController extends AdminBaseController
$this
->
menu
->
create
(
$request
->
all
());
Flash
::
success
(
'Menu created!'
);
return
Redirect
::
route
(
'dashboard.menu.index'
);
return
$this
->
request
->
route
(
'dashboard.menu.index'
);
}
public
function
edit
(
Menu
$menu
)
{
dd
(
'editing menu'
);
}
}
Resources/views/admin/menus/index.blade.php
View file @
d544f14e
...
...
@@ -38,18 +38,18 @@
<?php
foreach
(
$menus
as
$menu
)
:
?>
<tr>
<td>
<a
href=
"{{ URL::route('dashboard.
post
.edit', [$menu->id]) }}"
>
<a
href=
"{{ URL::route('dashboard.
menu
.edit', [$menu->id]) }}"
>
{{ $menu->name }}
</a>
</td>
<td>
<a
href=
"{{ URL::route('dashboard.
post
.edit', [$menu->id]) }}"
>
<a
href=
"{{ URL::route('dashboard.
menu
.edit', [$menu->id]) }}"
>
{{ $menu->title }}
</a>
</td>
<td>
<div
class=
"btn-group"
>
<a
href=
"{{ URL::route('dashboard.
post
.edit', [$menu->id]) }}"
class=
"btn btn-default btn-flat"
><i
class=
"glyphicon glyphicon-pencil"
></i></a>
<a
href=
"{{ URL::route('dashboard.
menu
.edit', [$menu->id]) }}"
class=
"btn btn-default btn-flat"
><i
class=
"glyphicon glyphicon-pencil"
></i></a>
<button
class=
"btn btn-danger btn-flat"
data-toggle=
"modal"
data-target=
"#confirmation-{{ $menu->id }}"
><i
class=
"glyphicon glyphicon-trash"
></i></button>
</div>
</td>
...
...
@@ -86,7 +86,7 @@
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
{{ trans('core::core.button.cancel') }}
</button>
{!! Form::open(['route' => ['dashboard.
post
.destroy', $menu->id], 'method' => 'delete', 'class' => 'pull-left']) !!}
{!! Form::open(['route' => ['dashboard.
menu
.destroy', $menu->id], 'method' => 'delete', 'class' => 'pull-left']) !!}
<button
type=
"submit"
class=
"btn btn-danger btn-flat"
><i
class=
"glyphicon glyphicon-trash"
></i>
{{ trans('core::core.button.delete') }}
</button>
{!! Form::close() !!}
</div>
...
...
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