Skip to content

Commit

Permalink
fix route:cache and config:cache issue
Browse files Browse the repository at this point in the history
  • Loading branch information
huydang284 committed Jul 2, 2018
1 parent 8a348f3 commit 2ff7e75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions Http/backendRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
use Illuminate\Routing\Router;

/** @var Router $router */
$router->bind('menu', function ($id) {
return app(\Modules\Menu\Repositories\MenuRepository::class)->find($id);
});
$router->bind('menuitem', function ($id) {
return app(\Modules\Menu\Repositories\MenuItemRepository::class)->find($id);
});

$router->group(['prefix' => '/menu'], function (Router $router) {
$router->get('menus', [
'as' => 'admin.menu.menu.index',
Expand Down
7 changes: 7 additions & 0 deletions Providers/MenuServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ public function register()
$event->load('menu', array_dot(trans('menu::menu')));
$event->load('menu-items', array_dot(trans('menu::menu-items')));
});

app('router')->bind('menu', function ($id) {
return app(MenuRepository::class)->find($id);
});
app('router')->bind('menuitem', function ($id) {
return app(MenuItemRepository::class)->find($id);
});
}

/**
Expand Down

0 comments on commit 2ff7e75

Please sign in to comment.