/**
  * Delete the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function delete($id)
 {
     $post = \App\Posts::find($id);
     $user_id = $post->user()->id;
     $post->delete();
     // Send a message to the user.
     $reason = $_POST['reason'];
     if (isset($_POST['other_reason']) && $_POST['other_reason'] != "") {
         $reason = $_POST['other_reason'];
     } else {
         $reason = $_POST['reason'];
     }
     $message = "Your post has been removed due to the following reason: " . $reason;
     \App\Message::send((int) $_POST['user_id'], 0, "Your post has been removed", $message);
     header('Location:' . url('admin/users/edit/' . $user_id));
     exit;
 }
 public function sendReply()
 {
     \App\Message::send($_POST['user_id'], 4, $_POST['title'], $_POST['message']);
     header('Location:' . url() . '/admin/messages');
     exit;
 }
 /**
  * Display a view for a reply to a message.
  *
  * @param  int  $id
  * @return Response
  */
 public function send()
 {
     \App\Message::send($_POST['user_id'], $_POST['sender_id'], $_POST['title'], $_POST['message']);
     header('Location:' . url() . '/message');
     exit;
 }