title: Finding a blade variable inside string
body: <p>I'm passing a $emailtemplate variable into a view.</p>
  
  <p>This $emailtemplate is a model with the following properties </p>
  
  <pre><code>(string) 'from_name', (string) 'from_email', (string) 'subject', (string) 'body', (string) 'email_type', (integer) 'status'
  </code></pre>
  
  <p>User's can create new instances of the $emailtemplate via a FORM on the site, where they can populate each of the fields above.</p>
  
  <p>An example of the body as populated by users into the FORM would be exactly the following line (yes users will be writing HTML code into the form to be stored in the body property of the $emailtemplate):</p>
  
  <pre><code>&lt;strong&gt;Dear {{$user-&gt;first_name}} &lt;/strong&gt;
  </code></pre>
  
  <p>I have created a view which will allow users to 'Preview' the email. The variables $emailtemplate and $user are both passed to the view (for the case of the preview the $user = Auth::user()) </p>
  
  <p><em>resources/views/emails/preview.blade.php</em>:</p>
  
  <pre><code>{!! $emailtemplate-&gt;body !}}
  </code></pre>
  
  <p>This 'preview' view correctly renders the strong styling however does not identify the blade variable reference as it is stored within a literal string.</p>
  
  <p>i.e. the HTML that is rendered is exactly</p>
  
  <p><strong>Dear {{$user->first_name}}</strong></p>
  
  <p>What is going wrong here? I want to allow Users to develop their own email templates via a form. I am passing both the $emailtemplate and $user into the view however because the $emailtemplate->body is a string datatype Laravel does not recognise the use of the blade variable between the parenthesis.</p>
  
  <p>How can I fix this? </p>
  
  <p>Thanks for your help</p>