不是通过 $notification->data 拿到在通知类 toDatabase () 里构建的数组,我的_topic_replied.blade.php 获取不到数据,页面显示是空白的

public function toDatabase($notifiable)
{
$topic = $this->reply->topic;
$link = $topic->link(['#reply' . $this->reply->id]);

    // 存入数据库里的数据
    return [
        'reply_id' => $this->reply->id,
        'reply_content' => $this->reply->content,
        'user_id' => $this->reply->user->id,
        'user_name' => $this->reply->user->name,
        'user_avatar' => $this->reply->user->avatar,
        'topic_link' => $link,
        'topic_id' => $topic->id,
        'topic_title' => $topic->title,
    ];

}
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
讨论数量: 3

还是没有解决掉这个问题

5年前 评论

@kingjian 数据库存进去了吗

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!