app->make('Lavalite\Autos\Interfaces\ManufacturerRepositoryInterface'); return $manufacturerrepo->findorNew($manufacturer); }); } if (Request::is('*/autos/car/*')) { Route::bind('car', function ($car) { $carrepo = $this->app->make('Lavalite\Autos\Interfaces\CarRepositoryInterface'); return $carrepo->findorNew($car); }); } if (Request::is('*/autos/automodel/*')) { Route::bind('automodel', function ($automodel) { $automodelrepo = $this->app->make('Lavalite\Autos\Interfaces\AutomodelRepositoryInterface'); return $automodelrepo->findorNew($automodel); }); } if (Request::is('*/autos/body/*')) { Route::bind('body', function ($body) { $bodyrepo = $this->app->make('Lavalite\Autos\Interfaces\BodyRepositoryInterface'); return $bodyrepo->findorNew($body); }); } } /** * 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() { if (request()->segment(1) == 'api' || request()->segment(2) == 'api') { return; } Route::group([ 'middleware' => 'web', 'namespace' => $this->namespace, 'prefix' => trans_setlocale(), ], function ($router) { require (__DIR__ . '/../../routes/web.php'); }); } }