예제 #1
0
 public function destroy($id)
 {
     $comment = Comment::find($id);
     $postId = $comment->post_id;
     Comment::destroy($id);
     return redirect('/posts/' . $postId);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $comment = Comment::find($id);
     Comment::destroy($id);
     if (Comment::where('author', $comment->author)->count() < 1) {
         User::where('author', $comment->author)->delete();
     }
     return response()->json(['success' => true]);
 }
예제 #3
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     //
     /* 循环删除
        for($i=0; $i<(count($this->id)); $i++)
        {
            $comment = Comment::findOrFail($this->id[$i]);
            $comment->delete();
        }
         */
     try {
         Comment::destroy($this->id);
     } catch (Exception $e) {
         return response($e->getMessage, 422);
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy()
 {
     Comment::destroy(request('id'));
     return back()->with('message', 'Kommentti poistettu!');
 }
예제 #5
0
 public function destroyCt($id)
 {
     //return $id;
     if (Comment::destroy([$id])) {
         return redirect()->back()->with('Mess', 'Đã xóa');
     } else {
         return redirect()->back()->with('errorMess', 'Có lỗi xảy ra, vui lòng thử lại sau!');
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($commentid, $id)
 {
     Comment::destroy($id);
     return Redirect::route('admin.comment.show', $commentid);
 }
예제 #7
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     return response()->json(Comment::destroy($id));
 }
예제 #8
0
 public function delete_comment(Request $request)
 {
     return Comment::destroy($request->get('id'));
 }
예제 #9
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     Comment::destroy($id);
 }
 public function destroy(Request $request)
 {
     $id = $request->get('id');
     Comment::destroy($id);
     // return Redirect::back();
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     if (Comment::destroy($id)) {
         return response()->json(array('status' => 'ok'));
     }
     return response()->json(array('status' => 'error'));
 }
예제 #12
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return response()->json(['success' => true]);
 }
예제 #13
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return redirect()->to('comment')->with('message', 'success create');
 }
예제 #14
0
 public function deletecomment($id)
 {
     Comment::destroy($id);
     Log::warning('Something could be going wrong.');
     return array('success' => true);
 }
예제 #15
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return response()->json(['status' => 'success', 'message' => 'Comment Deleted.']);
 }
예제 #16
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     return Comment::destroy($id);
 }
예제 #17
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return 'Commentaire supprimé';
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return Response::json(array('success' => true));
 }
예제 #19
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request)
 {
     $result = Comment::destroy($request->input('comment_id'));
     return response()->json(['result' => $result]);
 }