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);
 }
 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');
 }
 public function destroy($id)
 {
     $comment = Comment::find($id);
     if (!$comment->hasDefaultPhoto()) {
         File::delete($comment->fullPhotoPath());
     }
     Comment::destroy($id);
     return Response::json(array('success' => true));
 }
 /**
  * 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($post_id, $id)
 {
     //
     if (Comment::destroy($id)) {
         return Response::json(array('success' => true));
     } else {
         return Response::json(array('success' => false));
     }
 }
Esempio n. 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');
     }
 }
Esempio n. 7
0
 public function getCommentDel($id)
 {
     Comment::destroy();
     return Redirect::back()->with('message', 'Комментарий удален');
 }
 /**
  * Remove the specified comment from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Comment::destroy($id);
     return Redirect::route('comments.index');
 }
Esempio n. 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));
 }
Esempio n. 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));
 }