I'm trying to implement basic pagination when retrieving notifications, but I get the following error.
Method Illuminate\Notifications\DatabaseNotificationCollection::paginate does not exist.
public function index()
{
$messages = collect();
$notifications = auth()->user()->unreadNotifications->paginate(5);
foreach ($notifications as $notification) {
$message = NotificationToMessageFactory::make($notification->type)
->toMessage($notification->data);
$messages->push($message);
}
}