本文整理汇总了PHP中app\Comment::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::destroy方法的具体用法?PHP Comment::destroy怎么用?PHP Comment::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Comment
的用法示例。
在下文中一共展示了Comment::destroy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public function destroy($id)
{
$comment = Comment::find($id);
$postId = $comment->post_id;
Comment::destroy($id);
return redirect('/posts/' . $postId);
}
示例2: destroy
/**
* 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: handle
/**
* 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);
}
}
示例4: destroy
/**
* 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: destroyCt
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!');
}
}
示例6: destroy
/**
* 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: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
return response()->json(Comment::destroy($id));
}
示例8: delete_comment
public function delete_comment(Request $request)
{
return Comment::destroy($request->get('id'));
}
示例9: destroy
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
Comment::destroy($id);
}
示例10: destroy
public function destroy(Request $request)
{
$id = $request->get('id');
Comment::destroy($id);
// return Redirect::back();
}
示例11: destroy
/**
* 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: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Comment::destroy($id);
return response()->json(['success' => true]);
}
示例13: destroy
/**
* 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: deletecomment
public function deletecomment($id)
{
Comment::destroy($id);
Log::warning('Something could be going wrong.');
return array('success' => true);
}
示例15: destroy
/**
* 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.']);
}