@param NotificationInterface $notification

@return NotificationHandlerInterface[]
13202
private function getHandlersFor(NotificationInterface $notification): array
    {
        $handlers = [];
        foreach ($this->notificationHandlers as $notificationHandler) {
            if ($notificationHandler->supports($notification)) {
                $handlers[] = $notificationHandler;
            }
        }

        return $handlers;
    }
1313564
public function handle(NotificationInterface $notification, $level)
    {
        if ($notification instanceof AttributeAwareInterface)
        {
            $options = $notification->attributes();
        }
        else
        {
            $options = [];
        }

        if ($notification instanceof TitleAwareInterface)
        {
            $options['header'] = $notification->title();
        }

        $variable = [
            'message' => $notification->message(),
            'type'    => isset($this->levelMapping[$level]) ? $this->levelMapping[$level] : self::STANDARD,
            'options' => $options
        ];

        $current = $this->smarty->getTemplateVars($this->var);

        if (!$current)
        {
            $this->smarty->assign($this->var, [$variable]);
        }
        else
        {
            $this->smarty->append($this->var, $variable);
        }

        return true;
    }
351277
public function sendNotification(Notification $notification)
    {
        try {
            $connection = $this->getConnection($notification->getType());
            $connection->setNotification($notification);

            $this->logger->info(
                sprintf(
                    "Dispatching notification id: %s",
                    $notification->getIdentifier()
                )
            );

            $this
                ->responseHandler
                ->addIdentifiedResponse(
                    $notification->getIdentifier(),
                    $connection->sendRequest()
                );

            return true;

        } catch (ClientException $e) {
            $this->logger->error(
                sprintf("Client connection error: %s", $e->getMessage())
            );

        } catch (RuntimeException $e) {
            $this->logger->error(
                sprintf("Runtime error: %s", $e->getMessage())
            );

        } catch (\Exception $e) {
            $this->logger->error(
                sprintf("Error occurs: %s", $e->getMessage())
            );
        }

        return false;
    }
906549
public function notify(NotifyRequest $notification): Response
    {
        if ($this->appID !== null) {
            $notification->setApplicationIdentification($this->appID);
        }

        $response = $this->sendRequest($notification);
        return $response;

    }
926322
protected function pushNotification($notification, $notifiable)
    {
        if ($notifiable instanceof NotifiableGroup) {
            foreach ($notifiable->getGroup() as $toBeNotified) {
                $this->push($notification, $toBeNotified);
            }
        } else {
            // @todo Change this fucking shite
            $notification = $notifiable->notifications()->create($notification);

            event(new NotificationAdded($notification, $notifiable));
        }
    }
568439
private static function get_notification_details( $notification ) {
		$notifications = array_filter(
			self::$notifications,
			function ( $value ) use ( $notification ) {
				if ( isset( $value['id'] ) && isset( $notification['id'] ) && $value['id'] === $notification['id'] ) {
					return true;
				}

				return false;
			}
		);

		return ! empty( $notifications ) ? reset( $notifications ) : [];
	}
577744
public function handle(NotificationInterface $notification, $level)
    {
        return $this->logger->log($level, $notification->message());
    }
966935
public function send($notifiables, $notification)
    {
        return (new NotificationSender(
            $this, $this->app->make(Bus::class), $this->app->make(Dispatcher::class), $this->locale)
        )->send($notifiables, $notification);
    }
969940
public function serialize(PlannedNotification $notification, array $options)
    {
        return [
            'id' => $notification->getUuid(),
            'message' => $this->messageSerializer->serialize($notification->getMessage()),
            'workspace' => $this->workspaceSerializer->serialize($notification->getWorkspace(), [Options::SERIALIZE_MINIMAL]),
            'parameters' => [
                'action' => $notification->getAction(),
                'interval' => $notification->getInterval(),
                'byMail' => $notification->isByMail(),
                'byMessage' => $notification->isByMessage(),
            ],
            'roles' => array_map(function (Role $role) {
                return $this->roleSerializer->serialize($role, [Options::SERIALIZE_MINIMAL]);
            }, $notification->getRoles()->toArray()),
        ];
    }
69611
public function send($notifiables, $notification)
    {
        if (! $notifiables instanceof Collection && ! is_array($notifiables)) {
            $notifiables = [$notifiables];
        }

        if ($notification instanceof ShouldQueue) {
            return $this->queueNotification($notifiables, $notification);
        }

        return $this->sendNow($notifiables, $notification);
    }
187508
protected function listenNotificationsEvents(array $notification)
    {
        $events = Arr::get($notification, 'event');

        if($events === null && isset($notification['classname'])) {
            $events = app()->make($notification['classname'])->getEvents();
        }

        foreach ((array) $events as $event) {
            $this->runNotificationListener($event, $notification);
        }
    }
22314
public function withNotification($notification): self
    {
        $new = clone $this;
        $new->notification = $notification instanceof Notification ? $notification : Notification::fromArray($notification);

        return $new;
    }
1274147
public function send($notifiable, Notification $notification)
    {
        if (! $userIds = $notifiable->routeNotificationFor('OneSignal', $notification)) {
            return;
        }

        /** @var ResponseInterface $response */
        $response = $this->oneSignal->sendNotificationCustom(
            $this->payload($notifiable, $notification, $userIds)
        );

        if ($response->getStatusCode() !== 200) {
            throw CouldNotSendNotification::serviceRespondedWithAnError($response);
        }

        return $response;
    }
139315
public static function make($notifiable, Notification $notification, $targeting): array
    {
        $payload = $notification->toOneSignal($notifiable)->toArray();

        if (static::isTargetingEmail($targeting)) {
            $payload['filters'] = collect([['field' => 'email', 'value' => $targeting['email']]]);
        } elseif (static::isTargetingTags($targeting)) {
            $array = $targeting['tags'];
            $res = count($array) == count($array, COUNT_RECURSIVE);
            if ($res) {
                $payload['tags'] = collect([$targeting['tags']]);
            } else {
                $payload['tags'] = collect($targeting['tags']);
            }
        } elseif (static::isTargetingIncludedSegments($targeting)) {
            $payload['included_segments'] = collect($targeting['included_segments']);
        } elseif (static::isTargetingExcludedSegments($targeting)) {
            $payload['excluded_segments'] = collect($targeting['excluded_segments']);
        } elseif (static::isTargetingExternalUserIds($targeting)) {
            $payload['include_external_user_ids'] = collect($targeting['include_external_user_ids']);
        } else {
            $payload['include_player_ids'] = collect($targeting);
        }

        return $payload;
    }
309438
private function handleNotification(Notification $notification)
    {
        if (empty($notification->targetTypes())) {
            return;
        }
        $objectsByTypes = [];
        $numTotal = 0;
        foreach ($notification->targetTypes() as $objType) {
            $objType = trim($objType);
            $objects = $this->updatedObjects($objType);
            $num = count($objects);
            if ($num == 0) {
                continue;
            }
            $obj = [];
            $obj['objects'] = $objects;
            $obj['num'] = $num;
            $obj['type'] = $objType;
            $obj['typeLabel'] = isset($objects[0]['targetTypeLabel']) ? $objects[0]['targetTypeLabel'] : $objType;

            $objectsByTypes[$objType] = $obj;
            $numTotal += $num;
        }
        $this->sendEmail($notification, $objectsByTypes, $numTotal);
    }
939558
public function setSubject(NotificationInterface $notification, $subject, $flush = false)
    {
        $notification->setSubject($subject);
        $this->flush($flush);

        $event = new NotificationEvent($notification);
        $this->dispatcher->dispatch(MgiletNotificationEvents::MODIFIED, $event);

        return $notification;
    }
1064102
protected function handle(NotificationInterface $notification, NotificationHandlerInterface $handler): bool
    {
        if (! $handler->supports($notification)) {
            return false;
        }

        $cloned = clone $notification;

        $event = new NotifyEvent($cloned, $handler);
        $this->eventDispatcher->dispatch(Events::NOTIFY, $event);

        $handler->notify($cloned);

        foreach ($cloned->getResultSet()->all() as $result) {
            $notification->addResult($result);
        }

        return true;
    }