bind('news', function ($id) { $news = $this->app->make('\Test\Test\Interfaces\NewsRepositoryInterface'); return $news->findorNew($id); }); } if (Request::is('*/test/news-category/*')) { $router->bind('news-category', function ($id) { $news-category = $this->app->make('\Test\Test\Interfaces\NewsCategoryRepositoryInterface'); return $news-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'; }); } }