Commit d544f14e authored by Nicolas Widart's avatar Nicolas Widart

Correcting editing links

parent 930ad2c0
<?php namespace Modules\Menu\Http\Controllers\Admin;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Http\Request;
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');
}
}
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment