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 d0b1837 commit d8b2340
Show file tree
Hide file tree
Showing 2 changed files with 8 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('module', function ($module) {
return app(\Nwidart\Modules\Contracts\RepositoryInterface::class)->find($module);
});
$router->bind('theme', function ($theme) {
return app(\Modules\Workshop\Manager\ThemeManager::class)->find($theme);
});

$router->group(
['prefix' => '/workshop'],
function (Router $router) {
Expand Down
8 changes: 8 additions & 0 deletions Providers/WorkshopServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Modules\Workshop\Scaffold\Module\ModuleScaffold;
use Modules\Workshop\Scaffold\Theme\ThemeGeneratorFactory;
use Modules\Workshop\Scaffold\Theme\ThemeScaffold;
use Nwidart\Modules\Repository;

class WorkshopServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -52,6 +53,13 @@ public function register()
$event->load('modules', array_dot(trans('workshop::modules')));
$event->load('themes', array_dot(trans('workshop::themes')));
});

app('router')->bind('module', function ($module) {
return app(Repository::class)->find($module);
});
app('router')->bind('theme', function ($theme) {
return app(ThemeManager::class)->find($theme);
});
}

public function boot()
Expand Down

0 comments on commit d8b2340

Please sign in to comment.