title: Laravel blade templates, foreach variable inside URL::to?
body: <p>I'm creating a basic list view of posts, and need a link to the 'edit' page.</p>
  
  <p>I'm using blade, and what I have is a table, with a foreach loop, showing each post along with edit/delete buttons.</p>
  
  <p>What I wanted to do is use blade's URL::to for the links to the edit and delete pages, to ensure consistant links.</p>
  
  <p>The code I've tried using (remember this is inside a foreach loop hence the $post->id var) is this:</p>
  
  <pre><code>&lt;a href="{{ URL::to('admin/posts/edit/$post-&gt;id') }}" class="btn btn-mini btn-primary"&gt;Edit Post&lt;/a&gt;
  </code></pre>
  
  <p>However this does not work. I've also tried</p>
  
  <pre><code>&lt;a href="{{ URL::to('admin/posts/edit/&lt;?php echo $post-&gt;id; ?&gt;') }}" class="btn btn-mini btn-primary"&gt;Edit Post&lt;/a&gt;
  </code></pre>
  
  <p>which also doesnt work.</p>
  
  <p>I dont get any error, the link literally ends up being:</p>
  
  <pre><code>http://domain.dev/admin/posts/$post-&gt;id
  </code></pre>
  
  <p>Is there any way of working around this?</p>