app->make('CountriesStates\CountriesStates\Interfaces\CountriesRepositoryInterface'); return $countriesrepo->findorNew($countries); }); } if (Request::is('*/countries_states/states/*')) { Route::bind('states', function ($states) { $statesrepo = $this->app->make('CountriesStates\CountriesStates\Interfaces\StatesRepositoryInterface'); return $statesrepo->findorNew($states); }); } if (Request::is('*/countries_states/cities/*')) { Route::bind('cities', function ($cities) { $citiesrepo = $this->app->make('CountriesStates\CountriesStates\Interfaces\CitiesRepositoryInterface'); return $citiesrepo->findorNew($cities); }); } if (Request::is('*/countries_states/area/*')) { Route::bind('area', function ($area) { $arearepo = $this->app->make('CountriesStates\CountriesStates\Interfaces\AreaRepositoryInterface'); return $arearepo->findorNew($area); }); } } /** * 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'); }); } }