app->make('Restaurant\Restaurant\Interfaces\RestaurantRepositoryInterface'); return $restaurantrepo->findorNew($restaurant); }); } if (Request::is('*/restaurant/addon/*')) { Route::bind('addon', function ($addon) { $addonrepo = $this->app->make('Restaurant\Restaurant\Interfaces\AddonRepositoryInterface'); return $addonrepo->findorNew($addon); }); } if (Request::is('*/restaurant/category/*')) { Route::bind('category', function ($category) { $categoryrepo = $this->app->make('Restaurant\Restaurant\Interfaces\CategoryRepositoryInterface'); return $categoryrepo->findorNew($category); }); } if (Request::is('*/restaurant/menu/*')) { Route::bind('menu', function ($menu) { $menurepo = $this->app->make('Restaurant\Restaurant\Interfaces\MenuRepositoryInterface'); return $menurepo->findorNew($menu); }); } if (Request::is('*/restaurant/review/*')) { Route::bind('review', function ($review) { $reviewrepo = $this->app->make('Restaurant\Restaurant\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'); }); } }