示例#1
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(StoreDownloadRequest $request, Game $game, Download $download)
 {
     $input = array_except(Input::all(), '_method');
     $download->deleteDownloadFile();
     $download->update($input);
     $download->type = $request->input('type');
     $download->description = $request->input('description');
     $download->game_id = $game->id;
     $download->save();
     if ($request->hasFile('filename')) {
         $download->upload($request->file('filename'), $request->file('filename')->getClientOriginalExtension());
     }
     Session::flash('message', 'Download upated');
     return redirect('/game/' . $game->id . '/download');
 }