bind('store', function ($id) { $store = $this->app->make('\Assetdocs\Store\Interfaces\StoreRepositoryInterface'); return $store->findorNew($id); }); }if (Request::is('*/store/substore/*')) { $router->bind('substore', function ($id) { $substore = $this->app->make('\Assetdocs\Store\Interfaces\SubstoreRepositoryInterface'); return $substore->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'; }); } }