/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Question $question)
 {
     $delete = $question->delete();
     if ($delete) {
         return 0;
     } else {
         return 1;
     }
 }
Пример #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Question  $question
  * @return Redirect
  */
 public function destroy(Question $question)
 {
     if ($question->user->id != Auth::user()->id) {
         return Redirect::route("home");
     }
     $question->delete();
     return Redirect::route("ask.index")->with("success", "Soru başarıyla silindi!");
 }