app->make('Roberto\Roberto\Interfaces\1RepositoryInterface'); return $1repo->findorNew($1); }); } if (Request::is('*/roberto/1/*')) { Route::bind('1', function ($1) { $1repo = $this->app->make('Roberto\Roberto\Interfaces\1RepositoryInterface'); return $1repo->findorNew($1); }); } if (Request::is('*/roberto/2/*')) { Route::bind('2', function ($2) { $2repo = $this->app->make('Roberto\Roberto\Interfaces\2RepositoryInterface'); return $2repo->findorNew($2); }); } } /** * 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'); }); } }