ticketId = $ticketId; $this->title = $title; $this->url = $url; $this->reason = $reason; $this->is_user = $is_user; } public function via($notifiable) { return $this->is_user ? ['mail'] : sysConfig('ticket_closed_notification'); } public function toMail($notifiable) { return (new MailMessage) ->subject(trans('notification.close_ticket', ['id' => $this->ticketId, 'title' => $this->title])) ->line($this->reason) ->action(trans('notification.view_ticket'), $this->url) ->line(__('If your problem has not been solved, Feel free to open other one.')); } public function toCustom($notifiable) { return [ 'title' => trans('notification.close_ticket', ['id' => $this->ticketId, 'title' => $this->title]), 'content' => $this->reason, ]; } public function toTelegram($notifiable) { return TelegramMessage::create() ->token(sysConfig('telegram_token')) ->content($this->reason); } }