EricMakesStuff\ServerMonitor\Notifications\Notifier::sendNotification PHP Метод

sendNotification() защищенный Метод

protected sendNotification ( string $eventName, string $subject, string $message, string $type )
$eventName string
$subject string
$message string
$type string
    protected function sendNotification($eventName, $subject, $message, $type)
    {
        $senderNames = config("server-monitor.notifications.events.{$eventName}");
        collect($senderNames)->map(function ($senderName) {
            $className = $senderName;
            if (file_exists(__DIR__ . '/Senders/' . ucfirst($senderName) . '.php')) {
                $className = '\\EricMakesStuff\\ServerMonitor\\Notifications\\Senders\\' . ucfirst($senderName);
            }
            return app($className);
        })->each(function (SendsNotifications $sender) use($subject, $message, $type) {
            try {
                $sender->setSubject($subject)->setMessage($message)->setType($type)->send();
            } catch (Exception $exception) {
                $errorMessage = "Server Monitor notifier failed because {$exception->getMessage()}" . PHP_EOL . $exception->getTraceAsString();
                $this->log->error($errorMessage);
                monitorConsoleOutput()->error($errorMessage);
            }
        });
    }