Exemplo n.º 1
0
 public function doRelease($id)
 {
     try {
         $capture = Capture::where('user_id', \Auth::user()->id)->where('id', $id)->firstOrFail();
     } catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
         return view('errors.captureNotFound');
     }
     // Delete the old image
     \File::Delete('img/captures/' . $capture->photo);
     \Session::flash('release', 'Successfully released ' . $capture->pokemon->name);
     Capture::destroy($id);
     return redirect('pokecentre/captures');
 }