Get the notifiable's preferred locale for the notification.

@param  mixed  $notifiable
@param  mixed  $notification
@return string|null
509671
protected function preferredLocale($notifiable, $notification)
    {
        return $notification->locale ?? $this->locale ?? value(function () use ($notifiable) {
            if ($notifiable instanceof HasLocalePreference) {
                return $notifiable->preferredLocale();
            }
        });
    }
102352
protected function sourcePath($notifiable) //while refactoring
    {
        if ($notifiable->isAdmin()) {
            return route('orders.show_seller_order', $this->order);
        }

        return route('orders.show_order', $this->order);
    }
450525
public function toMail($notifiable)
    {
        $email = $notifiable->getEmailForEmailVerification();
        $link = route('verifyEmailLink', ['email' => $email, 'expiration' => $this->expiration, 'token' => $this->token]);
        return (new MailMessage)
            ->subject(trans('emailverification::messages.resend.title'))
            ->line(trans('emailverification::messages.email.welcome'))
            ->line(trans('emailverification::messages.email.instructions'))
            ->action(trans('emailverification::messages.email.action'), $link);
    }
1178725
public function send($notifiable, Notification $notification)
    {
        if (! $url = $notifiable->routeNotificationFor('Webhook')) {
            return;
        }

        $webhookData = $notification->toWebhook($notifiable)->toArray();

        $response = $this->client->post($url, [
            'body' => json_encode(Arr::get($webhookData, 'data')),
            'verify' => false,
            'headers' => Arr::get($webhookData, 'headers'),
        ]);

        if ($response->getStatusCode() >= 300 || $response->getStatusCode() < 200) {
            throw CouldNotSendNotification::serviceRespondedWithAnError($response);
        }
    }
1041084
public function send($notifiables, $notification)
    {
        $notifiables = $this->formatNotifiables($notifiables);

        if (! $notification instanceof ShouldQueueInterface) {
            return $this->sendNow($notifiables, $notification);
        }

        foreach ($notifiables as $notifiable) {
            $notificationId = Uuid::uuid4()->toString();

            foreach ($notification->via($notifiable) as $channel) {
                $this->queueToNotifiable($notifiable, $notificationId, clone $notification, $channel);
            }
        }
    }
1029038
public function toMail($notifiable)
    {
        $mail = (new MailMessage)
                    ->line($this->intro)
                    ->subject($this->subject);

        if ($this->confirmation) {
            $mail->replyTo($this->replyTo[0], $this->replyTo[1]);
        }

        $mail->viewData = [
                'rawText' => $this->createSubmissionEmail($this->submission),
                'rawTextPlain' => $this->createSubmissionEmailPlain($this->submission)
            ];

        return $mail;
    }
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');
    }
42333
public function send($notifiable, Notification $notification)
    {
        if (!$to = $notifiable->routeNotificationFor('SMS')) {
            return;
        }

        $message = $notification->toSMS($notifiable);
        if (is_string($message)) {
            $message = new SMSMessage($message);
        }

        $this->SMSManager
            ->channel($message->channel)
            ->send($to, $message->content);
    }
501938
protected function getData($notifiable, Notification $notification)
    {
        if (method_exists($notification, 'toBroadcast')) {
            return $notification->toBroadcast($notifiable);
        }

        if (method_exists($notification, 'toArray')) {
            return $notification->toArray($notifiable);
        }

        throw new RuntimeException('Notification is missing toArray method.');
    }
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);
    }
769903
protected function shouldSendNotification($notifiable, $notification, $channel)
    {
        $result = $this->events->until(
            new NotificationSending($notifiable, $notification, $channel)
        );

        return ($result !== false);
    }
571202
protected function getTo($notifiable)
    {
        if ($notifiable->routeNotificationFor('twilio')) {
            return $notifiable->routeNotificationFor('twilio');
        }
        if (isset($notifiable->phone_number)) {
            return $notifiable->phone_number;
        }

        throw CouldNotSendNotification::invalidReceiver();
    }
584123
public function via($notifiable)
    {
        return array_filter([
            Horizon::$slackWebhookUrl ? 'slack' : null,
            Horizon::$smsNumber ? 'nexmo' : null,
            Horizon::$email ? 'mail' : null,
        ]);
    }
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;
    }
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;
    }
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,
        ]);
    }
981546
public function send($notifiable, Notification $notification)
    {
        if (! $url = $notifiable->routeNotificationFor('slack')) {
            return;
        }

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

        $this->http->post($url, [
            'json' => [
                'text' => $message->content,
                'attachments' => $this->attachments($message),
            ],
        ]);
    }