app->make('Autos\Car\Interfaces\CarRepositoryInterface'); return $carrepo->findorNew($car); }); } if (Request::is('*/car/brand/*')) { Route::bind('brand', function ($brand) { $brandrepo = $this->app->make('Autos\Car\Interfaces\BrandRepositoryInterface'); return $brandrepo->findorNew($brand); }); } if (Request::is('*/car/car_model/*')) { Route::bind('car_model', function ($car_model) { $car_modelrepo = $this->app->make('Autos\Car\Interfaces\CarModelRepositoryInterface'); return $car_modelrepo->findorNew($car_model); }); } } /** * Define the routes for the package. * * @return void */ public function map() { $this->mapWebRoutes(); } /** * Define the "web" routes for the package. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { Route::group([ 'middleware' => 'web', 'namespace' => $this->namespace, ], function ($router) { require (__DIR__ . '/../../routes/web.php'); }); } }