user()->unreadNotifications()->latest()->get(); } public function read(string $id): void { $this->notifications->where('id', $id)->first()?->markAsRead(); $this->__unset('notifications'); } public function readAll(): void { $this->notifications->markAsRead(); $this->__unset('notifications'); } };