title: Populating js array in blade template
body: <p>I'm trying to build a javascript array of data for use in <a href="http://www.flotcharts.org/flot/examples/categories/index.html" rel="noreferrer">flot</a> from the result of a php DB query.</p>
  
  <p>When I'm outputting numbers ($lic->Users) it's fine, but whenever I try to output a string I get a completely blank page in the browser.</p>
  
  <p>I've tried:</p>
  
  <ul>
  <li><code>{{ $lic-&gt;CompanyName }}</code></li>
  <li><code>"&lt;?php echo $lic-&gt;CompanyName; ?&gt;"</code></li>
  <li><code>{{{ $lic-&gt;CompanyName }}}</code> </li>
  <li><code>'"'+ &lt;?php echo $lic-&gt;CompanyName; ?&gt; +'"'</code></li>
  </ul>
  
  <p>But when I hard-code it (to say, 'CompanyName'), it builds the bar graph (&amp; displays the page) just fine.</p>
  
  <pre><code>var data = 
  [
      @foreach($licdata as $lic)
      {
      'label': "{{ $lic-&gt;CompanyName }}",
      'data': [
                  ["{{ $lic-&gt;CompanyName }}", {{ $lic-&gt;Users }}], 
                  ["{{ $lic-&gt;CompanyName }}", {{ $lic-&gt;Emps }}]
              ]
      },
      @endforeach
  ];
  </code></pre>
  
  <p>I think it must be something to do with quoting/escaping the string in js, but I can't work out what, does anyone know what the correct syntax is?</p>