@param $notifiable_identifier
@param $notifiable_class

@return \Doctrine\ORM\QueryBuilder
427116
protected function getNotificationCoundQb($notifiable_identifier, $notifiable_class)
    {
        return $this->createQueryBuilder('nn')
            ->select('COUNT(nn.id)')
            ->join('nn.notifiableEntity', 'ne')
            ->where('ne.identifier = :notifiable_identifier')
            ->andWhere('ne.class = :notifiable_class')
            ->setParameter('notifiable_identifier', $notifiable_identifier)
            ->setParameter('notifiable_class', $notifiable_class)
        ;
    }
189623
public function toMail($notifiable)
    {
        $link = route('user.activate', $this->token);
        return (new MailMessage)
            ->subject('Activate your Account')
            ->line('Welcome to ' . config('app.name'))
            //->action('Notification Action', 'https://laravel.com')
            ->action('Activation Link', $link)
            ->line('We hope you will have a good experience');
    }
108058
public function toDatabase($notifiable)
    {
        $labelFed = [
            'source_id' => $this->order->id,
            'status' => 'new',
        ];

        return [
            'label' => Label::make('push.comments')->with($labelFed)->print(),
            'source_path' => $this->sourcePath($notifiable),
            'source_id' => $this->order->id,
            'status' => 'new',
        ];
    }
213483
protected function sendToNotifiable($notifiable, $id, $notification, $channel)
    {
        if (!$notification->id) {
            $notification->id = $id;
        }
//        if (! $this->shouldSendNotification($notifiable, $notification, $channel)) {
//            return;
//        }
        $response = $this->manager->channel($channel)->send($notifiable, $notification);

//        $this->events->dispatch(
//            new Events\NotificationSent($notifiable, $notification, $channel, $response)
//        );
        return $response;
    }
60216
public function send($notifiable, $item)
    {
        return (new MailMessage())
            ->line($this->getMessage($item))
            ->from(
                config('tddd.notifications.from.address'),
                config('tddd.notifications.from.name')
            )
            ->action($this->getActionTitle(), $this->getActionLink());
    }
819813
public function toMail($notifiable)
    {
        $frontendReferer = parse_url(request()->headers->get('referer'));
        $frontendURL = $frontendReferer['scheme'] . '://' . $frontendReferer['host'];
        if ($frontendReferer['port']) {
            $frontendURL .= (':' . $frontendReferer['port']);
        }
        $frontendURL .= $frontendReferer['path'];
        $email = request()->get('email');
        $resetUrl = $frontendURL . '#/password/reset?email=' . $email . '&reset_token=' . $this->token;
        return (new MailMessage)
            ->line('You are receiving this email because we received a password reset request for your account.')
            ->action('Reset Password', $resetUrl)
            ->line('If you did not request a password reset, no further action is required.');
    }
36441
public function toMail($notifiable): MailMessage
    {
        return (new MailMessage())
            ->subject(trans('cortex/auth::emails.register.welcome.subject'))
            ->line(config('cortex.auth.registration.moderated')
                ? trans('cortex/auth::emails.register.welcome.intro_moderation')
                : trans('cortex/auth::emails.register.welcome.intro_default')
            );
    }
197818
public function toMail($notifiable)
    {
        $mailMessage = (new MailMessage)
            ->error()
            ->subject($this->getMessageText())
            ->line($this->getMessageText());

        foreach ($this->getMonitorProperties() as $name => $value) {
            $mailMessage->line($name.': '.$value);
        }

        return $mailMessage;
    }
745669
public function toMail($notifiable)
    {
        $message = new MailMessage();
        $message
            ->from(config('laravel2step.verificationEmailFrom'), config('laravel2step.verificationEmailFromName'))
            ->subject(trans('laravel2step::laravel-verification.verificationEmailSubject'))
            ->greeting(trans('laravel2step::laravel-verification.verificationEmailGreeting', ['username' => $this->user->name]))
            ->line(trans('laravel2step::laravel-verification.verificationEmailMessage'))
            ->line($this->code)
            ->action(trans('laravel2step::laravel-verification.verificationEmailButton'), route('laravel2step::verificationNeeded'));

        return $message;
    }
422475
protected function getUsersToPullFor($notifiable)
    {
        foreach ($notifiable as $key => $toBeNotified) {
            if ( ! $toBeNotified instanceof Notifiable && ! $toBeNotified instanceof NotifiableGroup) {
                throw new NotNotifiableException("The members passed to the pull must implement the notifiable interface");
            }

            if ($toBeNotified instanceof NotifiableGroup) {
                $group = $toBeNotified->getGroup();

                if ($group instanceof Collection) {
                    $group = $group->all();
                }

                $notifiable = array_merge($notifiable, $group);

                unset($notifiable[$key]);
            }
        }

        return $notifiable;
    }
307162
public function send($notifiable, Notification $notification)
    {
        $notifiable->routeNotificationFor('database')->create([
            'id' => $notification->id,
            'type' => get_class($notification),
            'data' => $this->getData($notifiable, $notification),
            'read_at' => null,
        ]);
    }
804508
public function toMail($notifiable)
    {
        $modelInfo = array(
            'id' => $this->larametricsModel->id,
            'model' => $this->larametricsModel->model,
            'method' => $this->larametricsModel->method,
            'original' => json_decode($this->larametricsModel->original, true),
            'changes' => json_decode($this->larametricsModel->changes, true)
        );
        $alertColor = '#ff9f00';
        switch($this->larametricsModel->method) {
            case 'created':
                $alertColor = '#00B945';
            break;
            case 'deleted':
                $alertColor = '#BC001A';
            break;
        }

        return (new MailMessage)
            ->subject(env('LARAMETRICS_MODEL_SUBJECT', '[Larametrics Alert] A model has been ' . $modelInfo['method']))
            ->from(env('LARAMETRICS_FROM_EMAIL', 'alerts@larametrics.com'), env('LARAMETRICS_FROM_NAME', 'Larametrics Alerts'))
            ->view('larametrics::emails.model-changed', [
                'modelInfo' => $modelInfo,
                'alertColor' => $alertColor
            ]);
    }
1051607
public function send(NotifiableInterface $notifiable, Notification $notification)
    {
        /** @var ActiveRecord $modelClass */
        $notifiable = $notifiable->routeNotificationFor('database');

        return DatabaseNotification::create([
            'id' => $notification->id,
            'verb' => $notification->verb,
            'template' => $notification->getTemplate(),
            'notifiable_id' => $notifiable['notifiable_id'],
            'notifiable_class' => $notifiable['notifiable_class'],
            'data' => $notification->getData(),
        ]);
    }
978582
public function toMail($notifiable)
    {
        return (new MailMessage)
            ->greeting('Hey '.$notifiable->name)
            ->line('You have a brand new account on '.url('/'))
            ->line('But, you are receiving this email because we need you to activate your account.')
            ->action('Activate Account', url('activate/token', $this->token));
    }
1340268
public function send($notifiable, Notification $notification)
    {
        if (! $notifiable->routeNotificationFor('mail')) {
            return;
        }

        $message = $notification->toMail($notifiable);

        $this->mailer->send($message->view, $message->data(), function ($m) use ($notifiable, $notification, $message) {
            $recipients = $notifiable->routeNotificationFor('mail');

            if (is_array($recipients)) {
                $m->bcc($recipients);
            } else {
                $m->to($recipients);
            }

            $m->subject($message->subject ?: Str::title(
                Str::snake(class_basename($notification), ' ')
            ));

            foreach ($message->attachments as $attachment) {
                $m->attach($attachment['file'], $attachment['options']);
            }

            foreach ($message->rawAttachments as $attachment) {
                $m->attachData($attachment['data'], $attachment['name'], $attachment['options']);
            }
        });
    }
308962
public function toMail($notifiable)
    {
        return (new MailMessage)
            ->view('HCACL::emails.template')
            ->subject(trans('HCACL::users.activation.mail.subject'))
            ->line(trans('HCACL::users.activation.mail.text', ['email' => $notifiable->email]))
            ->action(trans('HCACL::users.activation.activate'), route('auth.activation', $this->token));
    }
807678
public function formatNotifiables($notifiables)
    {
        if (is_array($notifiables) || $notifiables instanceof Collection) {
            return $notifiables;
        }

        if ($notifiables instanceof Record) {
            return new Collection([$notifiables]);
        }

        return [$notifiables];
    }