本文整理汇总了PHP中Comment::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::destroy方法的具体用法?PHP Comment::destroy怎么用?PHP Comment::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Comment
的用法示例。
在下文中一共展示了Comment::destroy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroy
public function destroy($id)
{
$comment = Comment::findOrFail($id);
$this->authorOrAdminPermissioinRequire($comment->user_id);
Comment::destroy($id);
Flash::success(lang('Operation succeeded.'));
return Redirect::route('posts.show', $comment->post_id);
}
示例2: delete1
public function delete1($id)
{
$regno = Comment::where('id', $id)->first();
$data = $regno->email;
// return $data;
Comment::destroy($id);
return Redirect::to('mail')->with('deleted', $data . ' is successFull Deleted from Database');
}
示例3: destroy
public function destroy($id)
{
$comment = Comment::find($id);
if (!$comment->hasDefaultPhoto()) {
File::delete($comment->fullPhotoPath());
}
Comment::destroy($id);
return Response::json(array('success' => true));
}
示例4: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Comment::destroy($id);
return Response::json(array('success' => true));
}
示例5: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($post_id, $id)
{
//
if (Comment::destroy($id)) {
return Response::json(array('success' => true));
} else {
return Response::json(array('success' => false));
}
}
示例6: delete_comment
public function delete_comment($article_id, $comment_id)
{
$commentReference = Comment::findOrFail($comment_id);
$commentsAuthor = $commentReference->user()->first();
$commentsAuthor = $commentsAuthor;
if (Auth::check() && Auth::user()->username == $commentsAuthor->username || Auth::user()->isAdmin()) {
Comment::destroy($comment_id);
return Redirect::to(URL::previous());
} else {
return Redirect::route('login');
}
}
示例7: getCommentDel
public function getCommentDel($id)
{
Comment::destroy();
return Redirect::back()->with('message', 'Комментарий удален');
}
示例8: destroy
/**
* Remove the specified comment from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
Comment::destroy($id);
return Redirect::route('comments.index');
}
示例9: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
// try {
// Comment::destroy($id);
// return Response::json(array('success' => true));
// } catch(Exception $ex)
// {
// return Response::json(array('success' => false));
// }
if (Comment::destroy($id)) {
return Response::json(array('success' => true));
} else {
return Response::json(array('success' => false));
}
//return Response::json(array('success' => true));
}
示例10: testDeleteCommentErrorNoComment
public function testDeleteCommentErrorNoComment()
{
$comment = Comment::destroy(1);
$response = $this->action('delete', 'CommentController@destroy', array('rating_id' => 1, 'id' => 1));
$this->assertEquals(array("code" => ApiResponse::UNAVAILABLE_COMMENT, "data" => ApiResponse::getErrorContent(ApiResponse::UNAVAILABLE_COMMENT)), json_decode($response->getContent(), true));
}