app->make('Renfos\Timesheet\Interfaces\BoardRepositoryInterface'); return $boardrepo->findorNew($board); }); } if (Request::is('*/timesheet/column/*')) { Route::bind('column', function ($column) { $columnrepo = $this->app->make('Renfos\Timesheet\Interfaces\ColumnRepositoryInterface'); return $columnrepo->findorNew($column); }); } if (Request::is('*/timesheet/project/*')) { Route::bind('project', function ($project) { $projectrepo = $this->app->make('Renfos\Timesheet\Interfaces\ProjectRepositoryInterface'); return $projectrepo->findorNew($project); }); } if (Request::is('*/timesheet/project_user/*')) { Route::bind('project_user', function ($project_user) { $project_userrepo = $this->app->make('Renfos\Timesheet\Interfaces\ProjectUserRepositoryInterface'); return $project_userrepo->findorNew($project_user); }); } if (Request::is('*/timesheet/task/*')) { Route::bind('task', function ($task) { $taskrepo = $this->app->make('Renfos\Timesheet\Interfaces\TaskRepositoryInterface'); return $taskrepo->findorNew($task); }); } if (Request::is('*/timesheet/timesheet/*')) { Route::bind('timesheet', function ($timesheet) { $timesheetrepo = $this->app->make('Renfos\Timesheet\Interfaces\TimesheetRepositoryInterface'); return $timesheetrepo->findorNew($timesheet); }); } } /** * 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'); }); } }