I'm using Laravel's Notifications system to send a welcome email when users register. Everything works great, except I can't for the life of me figure out how to insert a line break in the greeting.
This is my code:
namespace App\Notifications\Auth;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class UserRegistered extends Notification
{
public function via($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Welcome to website!')
->greeting('Welcome '. $notifiable->name .'!')
->line('## Sub heading line')
->line('Paragraph line')
->markdown('mail.welcome');
}
}
I want to put a break here ->greeting('Welcome '. $notifiable->name .'!')
between the welcome and the name. Anyone know how I can do this? I've tried double space as described on markdown documentation. I've tried using nl2br()
. I've tried \n. I've tried <br>
. Nothing works.
https://stackoverflow.com/questions/26626256/how-to-insert-a-line-break-br-in-markdown – AloHA_ChiCken Oct 06 '17 at 02:19
in your double quotes – shashi Oct 06 '17 at 03:30
like `->greeting('Welcome
'. $notifiable->name .'!')` and all that does is print out "Welcome
name" – James Oct 06 '17 at 03:37