app->make('Cenos\Master\Interfaces\StoreRepositoryInterface'); return $storerepo->findorNew($store); }); } if (Request::is('*/master/product/*')) { Route::bind('product', function ($product) { $productrepo = $this->app->make('Cenos\Master\Interfaces\ProductRepositoryInterface'); return $productrepo->findorNew($product); }); } if (Request::is('*/master/topic/*')) { Route::bind('topic', function ($topic) { $topicrepo = $this->app->make('Cenos\Master\Interfaces\TopicRepositoryInterface'); return $topicrepo->findorNew($topic); }); } if (Request::is('*/master/region/*')) { Route::bind('region', function ($region) { $regionrepo = $this->app->make('Cenos\Master\Interfaces\RegionRepositoryInterface'); return $regionrepo->findorNew($region); }); } if (Request::is('*/master/storetype/*')) { Route::bind('storetype', function ($storetype) { $storetyperepo = $this->app->make('Cenos\Master\Interfaces\StoretypeRepositoryInterface'); return $storetyperepo->findorNew($storetype); }); } if (Request::is('*/master/prodsource/*')) { Route::bind('prodsource', function ($prodsource) { $prodsourcerepo = $this->app->make('Cenos\Master\Interfaces\ProdsourceRepositoryInterface'); return $prodsourcerepo->findorNew($prodsource); }); } if (Request::is('*/master/prodcat/*')) { Route::bind('prodcat', function ($prodcat) { $prodcatrepo = $this->app->make('Cenos\Master\Interfaces\ProdcatRepositoryInterface'); return $prodcatrepo->findorNew($prodcat); }); } if (Request::is('*/master/topiccat/*')) { Route::bind('topiccat', function ($topiccat) { $topiccatrepo = $this->app->make('Cenos\Master\Interfaces\TopiccatRepositoryInterface'); return $topiccatrepo->findorNew($topiccat); }); } if (Request::is('*/master/sourcecat/*')) { Route::bind('sourcecat', function ($sourcecat) { $sourcecatrepo = $this->app->make('Cenos\Master\Interfaces\SourcecatRepositoryInterface'); return $sourcecatrepo->findorNew($sourcecat); }); } if (Request::is('*/master/source/*')) { Route::bind('source', function ($source) { $sourcerepo = $this->app->make('Cenos\Master\Interfaces\SourceRepositoryInterface'); return $sourcerepo->findorNew($source); }); } if (Request::is('*/master/skill/*')) { Route::bind('skill', function ($skill) { $skillrepo = $this->app->make('Cenos\Master\Interfaces\SkillRepositoryInterface'); return $skillrepo->findorNew($skill); }); } if (Request::is('*/master/skillcat/*')) { Route::bind('skillcat', function ($skillcat) { $skillcatrepo = $this->app->make('Cenos\Master\Interfaces\SkillcatRepositoryInterface'); return $skillcatrepo->findorNew($skillcat); }); } if (Request::is('*/master/topictype/*')) { Route::bind('topictype', function ($topictype) { $topictyperepo = $this->app->make('Cenos\Master\Interfaces\TopictypeRepositoryInterface'); return $topictyperepo->findorNew($topictype); }); } } /** * Define the routes for the package. * * @return void */ public function map() { $this->mapWebRoutes(); $this->mapApiRoutes(); } /** * 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'); }); } /** * Define the "api" routes for the package. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { if(request()->segment(1) != 'api' && request()->segment(2) != 'api') { return; } Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace, 'prefix' => trans_setlocale() . '/api', ], function ($router) { require (__DIR__ . '/../../routes/api.php'); }); } }