当前位置: 首页>>代码示例>>PHP>>正文


PHP Comment::destroy方法代码示例

本文整理汇总了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);
 }
开发者ID:Kouga-Huang,项目名称:laravel-blog,代码行数:8,代码来源:CommentsController.php

示例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');
 }
开发者ID:KornelMbele,项目名称:ResultSystem,代码行数:8,代码来源:MailController.php

示例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));
 }
开发者ID:spinybeast,项目名称:cyclone-music-space.ru,代码行数:9,代码来源:CommentController.php

示例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));
 }
开发者ID:elminson,项目名称:laravel-angular-comment-app,代码行数:11,代码来源:CommentController.php

示例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));
     }
 }
开发者ID:Hungmaix94,项目名称:Medusa,代码行数:15,代码来源:PostCommentController.php

示例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');
     }
 }
开发者ID:jtaurus,项目名称:jtauri_blog,代码行数:12,代码来源:UserController.php

示例7: getCommentDel

 public function getCommentDel($id)
 {
     Comment::destroy();
     return Redirect::back()->with('message', 'Комментарий удален');
 }
开发者ID:RybinDen,项目名称:laravel-blog,代码行数:5,代码来源:AdminController.php

示例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');
 }
开发者ID:automotivecapstone,项目名称:capstone.dev,代码行数:11,代码来源:CommentsController.php

示例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));
 }
开发者ID:Hungmaix94,项目名称:Medusa,代码行数:23,代码来源:CommentController.php

示例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));
 }
开发者ID:anht37,项目名称:winelover_server,代码行数:6,代码来源:CommentTest.php


注:本文中的Comment::destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。