bind('article', function ($id) { $article = $this->app->make('\Article\Article\Interfaces\ArticleRepositoryInterface'); return $article->findorNew($id); }); }if (Request::is('*/article/category/*')) { $router->bind('category', function ($id) { $category = $this->app->make('\Article\Article\Interfaces\CategoryRepositoryInterface'); return $category->findorNew($id); }); } } /** * Define the routes for the application. * * @param \Illuminate\Routing\Router $router * * @return void */ public function map(Router $router) { $router->group(['namespace' => $this->namespace], function ($router) { require __DIR__ . '/../Http/routes.php'; }); } }