@param NotifiableInterface $notifiable
@param string              $order
@param null|int            $limit
@param null|int            $offset

@return array
6128
public function getUnseenNotifications(NotifiableInterface $notifiable, $order = 'DESC', $limit = null,
                                           $offset = null)
    {
        return $this->notifiableNotificationRepository->findAllByNotifiable(
            $this->generateIdentifier($notifiable),
            ClassUtils::getRealClass(get_class($notifiable)),
            false,
            $order,
            $limit,
            $offset
        );
    }
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;
    }
832428
public function toMail($notifiable)
    {
        $email = $notifiable->getEmailForPasswordReset();
        $expired = \config("auth.passwords.{$this->provider}.expire", 60);
        $url = \config('orchestra/foundation::routes.reset', 'orchestra::forgot/reset');
        $title = \trans('orchestra/foundation::email.forgot.title');

        $message = new MailMessage();

        $message->title($title)
                    ->level('warning')
                    ->line(\trans('orchestra/foundation::email.forgot.message.intro'))
                    ->action($title, \handles("{$url}/{$this->token}?email=".\urlencode($email)))
                    ->line(\trans('orchestra/foundation::email.forgot.message.expired_in', \compact('expired')))
                    ->line(\trans('orchestra/foundation::email.forgot.message.outro'));

        if (! \is_null($view = \config("auth.passwords.{$this->provider}.email"))) {
            $message->view($view, [
                'email' => $email,
                'fullname' => $notifiable->getRecipientName(),
            ]);
        }

        return $message;
    }
573567
public function getNotifications($limit = null, $order = 'desc')
    {
        $query = $this->getNotificationRelation()->orderBy('created_at', $order);
        if (! is_null($limit)) {
            $query->limit($limit);
        }

        return $query->get();
    }
655672
public function getNotificationsNotRead($limit = null, $order = 'desc')
    {
        $query = $this->getNotificationRelation()->byRead(0)->orderBy('created_at', $order);
        if (! is_null($limit)) {
            $query->limit($limit);
        }

        return $query->get();
    }
1134840
protected function messageBuilder($notifiable, $notification, $message)
    {
        return function ($mailMessage) use ($notifiable, $notification, $message) {
            $this->buildMessage($mailMessage, $notifiable, $notification, $message);
        };
    }
618675
public function findAllForNotifiableIdQb($id, $order = 'DESC')
    {
        return $this->createQueryBuilder('nn')
            ->addSelect('n')
            ->join('nn.notification', 'n')
            ->join('nn.notifiableEntity', 'ne')
            ->where('ne.id = :id')
            ->orderBy('n.id', $order)
            ->setParameter('id', $id)
        ;
    }
317704
public function send($notifiable, Notification $notification)
    {
        $message = $notification->toMail($notifiable);

        if (! $notifiable->routeNotificationFor('mail', $notification) &&
            ! $message instanceof Mailable) {
            return;
        }

        if ($message instanceof Mailable) {
            return $message->send($this->mailer);
        }

        $this->mailer->send(
            $this->buildView($message),
            array_merge($message->data(), $this->additionalMessageData($notification)),
            $this->messageBuilder($notifiable, $notification, $message)
        );
    }
1131943
public function send($notifiable, Notification $notification)
    {
        $message = $this->getData($notifiable, $notification);

        $event = new BroadcastNotificationCreated(
            $notifiable, $notification, is_array($message) ? $message : $message->data
        );

        if ($message instanceof BroadcastMessage) {
            $event->onConnection($message->connection)
                  ->onQueue($message->queue);
        }

        return $this->events->dispatch($event);
    }
21191
public function send($notifiable, Notification $notification)
    {
        $email = $notification->toMailDb($notifiable);
        $email->save();
        if ($email->id > 0) {
            return 1;
        }
        return 0;
    }
1369768
protected function buildPayload($notifiable, Notification $notification)
    {
        return [
            'id' => $notification->id,
            'type' => get_class($notification),
            'data' => $this->getData($notifiable, $notification),
            'read_at' => null,
        ];
    }
1010150
public function toSlack($notifiable)
    {
        $content = trans('notifications.component.status_update.slack.content', [
            'name'       => $this->component->name,
            'old_status' => $this->component->human_status,
            'new_status' => trans("cachet.components.status.{$this->status}"),
        ]);

        $status = 'info';

        if ($this->status <= 1) {
            $status = 'success';
        } elseif ($this->status === 2) {
            $status = 'warning';
        } elseif ($this->status >= 3) {
            $status = 'error';
        }

        return (new SlackMessage())
                    ->$status()
                    ->content(trans('notifications.component.status_update.slack.subject'))
                    ->attachment(function ($attachment) use ($content, $notifiable) {
                        $attachment->title($content, cachet_route('status-page'))
                                   ->fields(array_filter([
                                        'Component'  => $this->component->name,
                                        'Old Status' => $this->component->human_status,
                                        'New Status' => trans("cachet.components.status.{$this->status}"),
                                        'Link'       => $this->component->link,
                                    ]))
                                   ->footer(trans('cachet.subscriber.unsubscribe', ['link' => cachet_route('subscribe.unsubscribe', $notifiable->verify_code)]));
                    });
    }
77188
public function render(NotifiableInterface $notifiable, array $options = array())
    {
        if (!array_key_exists('seen', $options)) {
            $options['seen'] = true;
        }

        return $this->renderNotifications($notifiable, $options);
    }
909945
public function isSeen(NotifiableInterface $notifiable, NotificationInterface $notification)
    {
        $nn = $this->getNotifiableNotification($notifiable, $notification);
        if ($nn) {
            return $nn->isSeen();
        }

        throw new EntityNotFoundException('The link between the notifiable and the notification has not been found');
    }
616627
public function markAsUnseen(NotifiableInterface $notifiable, NotificationInterface $notification, $flush = false)
    {
        $nn = $this->getNotifiableNotification($notifiable, $notification);
        if ($nn) {
            $nn->setSeen(false);
            $event = new NotificationEvent($notification, $notifiable);
            $this->dispatcher->dispatch(MgiletNotificationEvents::UNSEEN, $event);
            $this->flush($flush);
        } else {
            throw new EntityNotFoundException('The link between the notifiable and the notification has not been found');
        }
    }
955816
public function toMail($notifiable)
    {
        $content = trans('notifications.component.status_update.mail.content', [
            'name'       => $this->component->name,
            'old_status' => $this->component->human_status,
            'new_status' => trans("cachet.components.status.{$this->status}"),
        ]);

        return (new MailMessage())
            ->subject(trans('notifications.component.status_update.mail.subject'))
            ->markdown('notifications.component.update', [
                'componentName'          => $this->component->name,
                'content'                => $content,
                'unsubscribeText'        => trans('cachet.subscriber.unsubscribe'),
                'unsubscribeUrl'         => cachet_route('subscribe.unsubscribe', $notifiable->verify_code),
                'manageSubscriptionText' => trans('cachet.subscriber.manage_subscription'),
                'manageSubscriptionUrl'  => cachet_route('subscribe.manage', $notifiable->verify_code),
        ]);
    }
39595
public function toMail($notifiable)
    {
        return (new MailMessage)
            ->line('Hey '.$notifiable->name)
            ->line('We have a notfiication for you.')
            ->line($this->info['title'])
            ->line($this->info['details'])
            ->action('Visit here for more info', url('/user/notifications'));
    }