app->make('Restaurant\Master\Interfaces\CategoryRepositoryInterface'); return $categoryrepo->findorNew($category); }); } if (Request::is('*/master/cuisine/*')) { Route::bind('cuisine', function ($cuisine) { $cuisinerepo = $this->app->make('Restaurant\Master\Interfaces\CuisineRepositoryInterface'); return $cuisinerepo->findorNew($cuisine); }); } if (Request::is('*/master/master/*')) { Route::bind('master', function ($master) { $masterrepo = $this->app->make('Restaurant\Master\Interfaces\MasterRepositoryInterface'); return $masterrepo->findorNew($master); }); } } /** * 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'); }); } }