public function edit($id) { return view('playthrough.edit', ['players' => User::get(['id', 'nickname', 'profile_photo']), 'games' => Game::get(['id', 'name', 'photo']), 'playthrough' => Playthrough::find($id), 'p_id' => $id]); }
Route::get('admin/roles/create', ['uses' => 'AdminController@createRole', 'as' => 'admin.roles.create']); Route::post('admin/roles/create', ['uses' => 'AdminController@storeRole', 'as' => 'admin.roles.store']); Route::post('admin/roles/update', ['uses' => 'AdminController@updateRole', 'as' => 'admin.roles.update']); Route::get('admin/permissions', ['uses' => 'AdminController@permissions', 'as' => 'admin.permissions']); Route::get('admin/permissions/create', ['uses' => 'AdminController@createPermission', 'as' => 'admin.permissions.create']); Route::post('admin/permissions/update', ['uses' => 'AdminController@updatePermission', 'as' => 'admin.permissions.update']); Route::get('admin/users', ['uses' => 'AdminController@users', 'as' => 'admin.users']); Route::get('admin/user/edit/{id}', ['uses' => 'AdminController@user', 'as' => 'admin.user.edit']); Route::get('admin/game/index', ['uses' => 'AdminController@indexGames', 'as' => 'admin.game.index']); /* Register and Login */ Route::get('auth/login', 'Auth\\AuthController@getLogin'); Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout'); Route::controllers(['password' => 'Auth\\PasswordController']); Route::get('api/game/{id}', ['as' => 'api.game', function ($id) { $bgg = new \App\Bgg(); $bgg->getBoardGame($id); //return response()->json( $bgg->getBoardGame($id), 200, [], JSON_PRETTY_PRINT ); }]); Route::get('api/search/{text}', ['as' => 'api.search', function ($text = null) { $bgg = new \App\Bgg(); return response()->json($bgg->search($text), 200, [], JSON_PRETTY_PRINT); }]); Route::get('api/playthrough/players/{id}', ['as' => 'api.players', function ($id) { $st = ""; $players = Playthrough::find($id)->participants; foreach ($players as $p) { $st .= $p->id . ','; } return $st; }]);