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]); }
/** * 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!'); }
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); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { return response()->json(Comment::destroy($id)); }
public function delete_comment(Request $request) { return Comment::destroy($request->get('id')); }
/** * 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')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { Comment::destroy($id); return response()->json(['success' => true]); }
/** * 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'); }
public function deletecomment($id) { Comment::destroy($id); Log::warning('Something could be going wrong.'); return array('success' => true); }
/** * 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.']); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { return Comment::destroy($id); }
/** * 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)); }
/** * 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]); }