I am working on an email template for our site and have a component that renders the text version of the email content. This particular component is supposed to generate centered: title, body, and call to action, so in the text version, I am trying to use the str_pad() function to center the text based on a 60 column layout.
It seems that Blade is trimming leading whitespace so my text always lines up left aligned.
Here is an example of how I set up the code:
...
@isset($title)
{{ str_pad(strtoupper($title), 60, ' ', STR_PAD_BOTH) }}
@endisset
...
It renders like this:
TEXT BLOCK CENTER
but I am expecting this:
TEXT BLOCK CENTER
if I do a dd():
{{dd(str_pad(strtoupper($title), 60, ' ', STR_PAD_BOTH))}}
it renders correctly in the dd().
Is there something I am missing which will allow the leading white spaces?