本文整理汇总了PHP中app\Message::send方法的典型用法代码示例。如果您正苦于以下问题:PHP Message::send方法的具体用法?PHP Message::send怎么用?PHP Message::send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Message
的用法示例。
在下文中一共展示了Message::send方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* 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;
}
示例2: sendReply
public function sendReply()
{
\App\Message::send($_POST['user_id'], 4, $_POST['title'], $_POST['message']);
header('Location:' . url() . '/admin/messages');
exit;
}
示例3: send
/**
* 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;
}