コード例 #1
0
 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
0
 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
0
 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
0
 /**
  * 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
0
 /**
  * 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
0
 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
0
 public function getCommentDel($id)
 {
     Comment::destroy();
     return Redirect::back()->with('message', 'Комментарий удален');
 }
コード例 #8
0
 /**
  * Remove the specified comment from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return Redirect::route('comments.index');
 }
コード例 #9
0
 /**
  * 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
0
 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));
 }