/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id, CreateClubRequest $request, Club $club) { $player_to_update = $club->find($id); $uploaded_image = $request->file('image_upload'); $parameter = $request->all(); if (isset($uploaded_image)) { $ext = $uploaded_image->getClientOriginalExtension(); $newImageName = $player_to_update->id . "." . $ext; $uploaded_image->move(base_path() . '/public/img/uploads/club/', $newImageName); Image::make(base_path() . '/public/img/uploads/club/' . $newImageName, array('width' => 160, 'height' => 200))->save(base_path() . '/public/img/uploads/thumbnails/club/' . $newImageName); $parameter = $request->all(); $parameter['image'] = $newImageName; /* remove this field from the parameters list */ unset($parameter['image_upload']); $player_to_update->update($parameter); } else { $player_to_update->update($request->all()); $player_to_update->update($parameter); } return redirect('clubs'); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id, Coach $coach, Club $club) { return view('admin.coach.edit')->with('coach', $coach->find($id))->with('club', $club->all()); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id, ClubHistory $clubhistories, Club $club, ChampionshipDetail $championship) { return view('admin.clubhistories.edit')->with('clubhistories', $clubhistories->find($id))->with('club', $club->all())->with('championship', $championship->all()); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id, PlayerHistory $playerhistories, Player $player, Club $club) { return view('admin.playerhistories.edit')->with('playerhistories', $playerhistories->find($id))->with('players', $player->lists('name', 'id'))->with('club', $club->lists('name', 'id')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id, CoachDetail $clubhistories, Club $club, ChampionshipDetail $championship, Coach $coach) { return view('admin.coachdetail.edit')->with('coachdetail', $clubhistories->find($id))->with('club', $club->lists('name', 'id'))->with('coach', $coach->lists('name', 'id')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id, Club $club, Player $player) { return view('admin.players.edit')->with('player', $player->find($id))->with('club', $club->all()); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id, Event $event, Club $club, Championship $championship) { return view('admin.events.edit')->with('event', $event->find($id))->with('championship', $championship->lists('championship_name', 'id'))->with('club', $club->lists('name', 'id')); }