$unreadNotifications = $user->unreadNotifications()
->with('users')
->get();
Call to undefined relationship [users] on model [Illuminate\Notifications\DatabaseNotification].
$user = User::find(Auth::id());
foreach ($user->unreadNotifications as $notification) {
$aaa = Comment::with('post)
->with('users')
->where('post_id', $notification->data['post_id'])
->where('user_id', $notification->data['user_comment_id'])
->where('id', $notification->data['comment_id'])
->get();
dump($aaa);
}
$collect1 = collect(Post::find($notification->data['post_id']));
$collect2 = collect(['user_comment' => Comment::find($notification->data['comment_id'])->text]);
$collect3 = collect(['user_name' => User::find($notification->data['user_comment_id'])->name]);
$allData->push($collect1
->merge($collect2)
->merge($collect3)
->merge(['id_notif' => $notification->id]));