channels('store_connected'); } public function toMail(object $notifiable): MailMessage { return (new MailMessage()) ->subject('WooCommerce store connected — '.($this->store->site_name ?? parse_url($this->store->site_url, PHP_URL_HOST))) ->view('mail.notifications.woo-store-connected', [ 'store' => $this->store, 'manageUrl' => route('woo.dashboard'), ]); } /** @return array */ public function toArray(object $notifiable): array { $label = $this->store->site_name ?? parse_url($this->store->site_url, PHP_URL_HOST) ?? 'your store'; return [ 'title' => 'Store connected', 'message' => "{$label} is now linked to Ladill Woo Manager.", 'icon' => 'success', 'milestone' => 'store_connected', 'url' => route('woo.stores.index'), 'store_id' => $this->store->id, ]; } /** @return list */ private function channels(string $event): array { $config = (array) config("notifications.woo_events.{$event}", ['mail' => true, 'database' => true]); $channels = []; if ($config['mail'] ?? false) { $channels[] = 'mail'; } if ($config['database'] ?? false) { $channels[] = 'database'; } return $channels ?: ['database']; } }