I am trying to send notification
with a name or email parameter.
Controller
$subscriber = Subscribe::whereNotNull('verified')->get();
Notification::send($subscriber, new NotifySubscriber($post));
toMail function
public function toMail($notifiable)
{
$url = url('/news/' . $this->post->slug);
return (new MailMessage)
->greeting('Dear User')
->line('Title : ' . $this->post->title)
->action('Read More', $url)
}
I want ->greeting('Dear User')
with user name. Like ->greeting('Dear User' . $this->user->name)
The following didn't work as well:
Notification::send($subscriber, new NotifySubscriber($post, $subscriber));
What should I do?