newUser = $newUser; $this->sender = $sender; } /** * Get the notification's delivery channels. */ public function via($notifiable): array { return ['database']; } /** * Get the array representation of the notification. */ public function toArray($notifiable): array { return [ 'user_id' => $this->newUser->id, 'sender_id' => $this->sender ? $this->sender->id : null, 'type' => 'user_activation_required', 'message' => $this->getNotificationMessage(), 'user_name' => $this->newUser->name ?? 'Unknown', 'user_email' => $this->newUser->email ?? 'Unknown', 'user_status' => $this->newUser->status ?? 'pending', ]; } /** * Get notification message */ private function getNotificationMessage(): string { $userName = $this->newUser->name ?? 'Unknown'; $userEmail = $this->newUser->email ?? 'Unknown'; return "Pengguna baru memerlukan pengaktifan. Nama: {$userName}, Email: {$userEmail}"; } }