|null $data */ public function send(User $user, NotificationType $type, string $title, string $body, ?array $data = null): Notification { return $user->notifications()->create([ 'type' => $type, 'title' => $title, 'body' => $body, 'data' => $data, ]); } public function markAllAsRead(User $user): void { $user->notifications()->whereNull('read_at')->update(['read_at' => now()]); } }