app->make('Litepci\Product\Interfaces\ProductRepositoryInterface'); return $productrepo->findorNew($product); }); } if (Request::is('*/product/brand/*')) { Route::bind('brand', function ($brand) { $brandrepo = $this->app->make('Litepci\Product\Interfaces\BrandRepositoryInterface'); return $brandrepo->findorNew($brand); }); } if (Request::is('*/product/category/*')) { Route::bind('category', function ($category) { $categoryrepo = $this->app->make('Litepci\Product\Interfaces\CategoryRepositoryInterface'); return $categoryrepo->findorNew($category); }); } if (Request::is('*/product/listing/*')) { Route::bind('listing', function ($listing) { $listingrepo = $this->app->make('Litepci\Product\Interfaces\ListingRepositoryInterface'); return $listingrepo->findorNew($listing); }); } if (Request::is('*/product/tag/*')) { Route::bind('tag', function ($tag) { $tagrepo = $this->app->make('Litepci\Product\Interfaces\TagRepositoryInterface'); return $tagrepo->findorNew($tag); }); } if (Request::is('*/product/review/*')) { Route::bind('review', function ($review) { $reviewrepo = $this->app->make('Litepci\Product\Interfaces\ReviewRepositoryInterface'); return $reviewrepo->findorNew($review); }); } } /** * 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'); }); } }