@param NotifiableEntity $notifiableEntity

@return NotifiableInterface

@throws \RuntimeException
@throws \InvalidArgumentException
349771
public function getNotifiableInterface(NotifiableEntity $notifiableEntity)
    {
        return $this->notifiableRepository->findNotifiableInterface(
            $notifiableEntity,
            $this->getNotifiableEntityIdentifiers($notifiableEntity)
        );
    }
1346228
public function toMail($notifiable)
    {
        return (new MailMessage)
            ->subject($this->subject)
            ->view($this->view, [
                'name' => $notifiable->fullName,
                'route' => $this->route($notifiable),
            ]);
    }
315930
public function toMail($notifiable)
    {
        return (new MailMessage())
                    ->subject(trans('notifications.user.invite.mail.subject'))
                    ->greeting(trans('notifications.user.invite.mail.title', ['app_name' => Config::get('setting.app_name')]))
                    ->action(trans('notifications.user.invite.mail.action'), cachet_route('signup.invite', [$notifiable->code]))
                    ->line(trans('notifications.user.invite.mail.content', ['app_name' => Config::get('setting.app_name')]));
    }
426669
public function toMail($notifiable)
    {
        return (new MailMessage)->subject('Please confirm your account')
            ->greeting("Dear {$notifiable->firstname}")
            ->line("Thank you for registering at <strong>" . config('app.name') . '</strong>.')
            ->line("&nbsp;")
            ->line('Before you can sign into your account. Please confirm your email address.')
            ->action('Confirm Account',
                url('/auth/register/confirm/' . $notifiable->confirmation_token));
        //->line("<strong>Account Holder Details</strong>")
        //->line("Fullname: {$notifiable->fullname}")
        //->line("Email: {$notifiable->email}")
        //->line("&nbsp;")

    }
200956
private function formatNotifiable($notifiable)
    {
        if ($notifiable instanceof Model) {
            return FormatModel::given($notifiable);
        } elseif ($notifiable instanceof AnonymousNotifiable) {
            return 'Anonymous:'.implode(',', $notifiable->routes);
        }

        return get_class($notifiable);
    }
7519
public function getNotificationCount(NotifiableInterface $notifiable)
    {
        return $this->notifiableNotificationRepository->getNotificationCount(
            $this->generateIdentifier($notifiable),
            ClassUtils::getRealClass(get_class($notifiable))
        );
    }
846999
public function toMail($notifiable)
    {
        $content = trans('notifications.schedule.new.mail.content', [
            'name' => $this->schedule->name,
            'date' => $this->schedule->scheduled_at_formatted,
        ]);

        return (new MailMessage())
            ->subject(trans('notifications.schedule.new.mail.subject'))
            ->markdown('notifications.schedule.new', [
                '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),
        ]);
    }
483407
public function toMail($notifiable)
    {
        return (new MailMessage)->subject('Contact Us')
            ->greeting("Dear {$notifiable->firstname}")
            ->line("The following information was submitted from the <strong>Contact Us</strong>.")
            ->line('&nbsp;')
            ->line("<strong>Contact Us Details</strong>")
            ->line("Fullname: {$this->contactUs->fullname}")
            ->line("Email: {$this->contactUs->email}")
            ->line("Phone: {$this->contactUs->phone}")
            ->line("Enquiry: {$this->contactUs->content}")
            ->action('View Contact Us Report', url('/admin/reports/contact-us'));
    }
907203
public function findOne($notification_id, $notifiable_id)
    {
        return $this->createQueryBuilder('nn')
            ->join('nn.notification', 'n')
            ->join('nn.notifiableEntity', 'ne')
            ->where('n.id = :notification_id')
            ->andWhere('ne.id = :notifiable_id')
            ->setParameter('notification_id', $notification_id)
            ->setParameter('notifiable_id', $notifiable_id)
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
1348331
protected function getData($notifiable, Notification $notification)
    {
        if (method_exists($notification, 'toDatabase')) {
            $data = $notification->toDatabase($notifiable);

            return is_array($data) ? $data : $data->data;
        } elseif (method_exists($notification, 'toArray')) {
            return $notification->toArray($notifiable);
        }

        throw new RuntimeException(
            'Notification is missing toDatabase / toArray method.'
        );
    }
798656
public function findAllForNotifiable($notifiable_identifier, $notifiable_class, $order = 'DESC')
    {
        return $this->createQueryBuilder('nn')
            ->join('nn.notifiableEntity', 'ne')
            ->join('nn.notification', 'no')
            ->where('ne.identifier = :identifier')
            ->andWhere('ne.class = :class')
            ->setParameter('identifier', $notifiable_identifier)
            ->setParameter('class', $notifiable_class)
            ->orderBy('no.id', $order)
            ->getQuery()
            ->getResult()
        ;
    }
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)
        );
    }
755550
protected function formatNotifiables($notifiables)
    {
        // Notifiables can be an anonymous function that returns an array
        if (is_callable($notifiables)) {
            $notifiables = $notifiables();
        }

        // Always make sure we have an array
        if (! is_array($notifiables)) {
            return [$notifiables];
        }

        return $notifiables;
    }
1133551
public function send($notifiable, Notification $notification)
    {
        return $notifiable->routeNotificationFor('database', $notification)->create(
            $this->buildPayload($notifiable, $notification)
        );
    }
1076286
public function markAllAsSeen(NotifiableInterface $notifiable, $flush = false)
    {
        $nns = $this->notifiableNotificationRepository->findAllForNotifiable(
            $this->generateIdentifier($notifiable),
            ClassUtils::getRealClass(get_class($notifiable))
        );
        foreach ($nns as $nn) {
            $nn->setSeen(true);
            $event = new NotificationEvent($nn->getNotification(), $notifiable);
            $this->dispatcher->dispatch(MgiletNotificationEvents::SEEN, $event);
        }
        $this->flush($flush);
    }
468406
protected function verificationUrl($notifiable)
    {
        return URL::temporarySignedRoute(
            'verification.verify',
            Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
            ['id' => $notifiable->getKey()]
        );
    }
920487
public function addNotifiableNotification(NotifiableNotification $notifiableNotification)
    {
        if (!$this->notifiableNotifications->contains($notifiableNotification)) {
            $this->notifiableNotifications[] = $notifiableNotification;
            $notifiableNotification->setNotifiableEntity($this);
        }

        return $this;
    }