app->make('Company\CompanyStructure\Interfaces\HallRepositoryInterface'); return $hallrepo->findorNew($hall); }); } if (Request::is('*/company_structure/line/*')) { Route::bind('line', function ($line) { $linerepo = $this->app->make('Company\CompanyStructure\Interfaces\LineRepositoryInterface'); return $linerepo->findorNew($line); }); } if (Request::is('*/company_structure/equipment/*')) { Route::bind('equipment', function ($equipment) { $equipmentrepo = $this->app->make('Company\CompanyStructure\Interfaces\EquipmentRepositoryInterface'); return $equipmentrepo->findorNew($equipment); }); } if (Request::is('*/company_structure/department/*')) { Route::bind('department', function ($department) { $departmentrepo = $this->app->make('Company\CompanyStructure\Interfaces\DepartmentRepositoryInterface'); return $departmentrepo->findorNew($department); }); } if (Request::is('*/company_structure/employees/*')) { Route::bind('employees', function ($employees) { $employeesrepo = $this->app->make('Company\CompanyStructure\Interfaces\EmployeesRepositoryInterface'); return $employeesrepo->findorNew($employees); }); } if (Request::is('*/company_structure/department_role/*')) { Route::bind('department_role', function ($department_role) { $department_rolerepo = $this->app->make('Company\CompanyStructure\Interfaces\DepartmentRoleRepositoryInterface'); return $department_rolerepo->findorNew($department_role); }); } } /** * 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'); }); } }