예제 #1
0
 /**
  * Remove the specified resource from storage.
  * DELETE /challenges/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $challenge = Challenge::findOrFail($id);
     if ($challenge->user_id === $this->currentUser->id) {
         $challenge->delete();
         return Redirect::route('backend.challenges.index');
     }
     App::abort(404);
 }