title: Laravel - Retain Value from Form Post
body: <p>I currently have a drop-down box that filters data in my view. After the form posts I would like to retain the selected "publication_id" from the post so it can be used for additional filtering if needed.</p>
  
  <p>Here is my current code</p>
  
  <pre><code>&lt;select name="publication_id" id="publication_id" class="form-control input-sm" &gt;
  @foreach($publications as $publication)
  &lt;option value="{{ $publication-&gt;id }}" &lt;?php if(isset($_GET['publication_id']) == '{{ $publication-&gt;id }}') echo 'selected'; ?&gt;&gt;{{ $publication-&gt;name }}&lt;/option&gt;
  @endforeach
  &lt;/select&gt;
  </code></pre>
  
  <p>The problem is that the selected value after the post always defaults to the last option in the foreach loop from above. How can I get this working properly?</p>