Facebook通知样式分组

时间:2018-11-11 19:01:02

标签: laravel

{
"id": "1ce9c7bb-92b6-4566-87ab-dd63e929feb6",
"type": "App\Notifications\ReplyWasLeft",
"notifiable_type": "App\User",
"notifiable_id": 1,
"data": {
"name": "Wilford Gibson",
"title": "test",
"link": "/prof-valentin-kohler-dds/discussion/1#reply-3",
"message": " replied to the Discussion that you interacted with."
},
"read_at": null,
},

{
"id": "185c93d2-d06e-4291-ad81-03dd9f25e5dc",
"type": "App\Notifications\ReplyWasLeft",
"notifiable_type": "App\User",
"notifiable_id": 1,
"data": {
"name": "Agustin Considine",
"title": "test",
"link": "/prof-valentin-kohler-dds/discussion/1#reply-1",
"message": " replied to the Discussion that you interacted with."
},
"read_at": null,
}

我想将属于同一讨论的类似通知归为一个单独的通知,例如facebook样式。

使用上面的示例,可以将其合并为 Wilford Gibson和另外1个人回答了您与之互动的讨论

到目前为止,我只能消除相似之处,并使用来获取最新通知

auth()->user()->keyBy(''title')->values();

0 个答案:

没有答案