title: laravel blade how to set the options for drop down list
body: <p>I am trying to create an drop down list using <code>blade</code></p>
  
  <p>I have already checked this question <a href="https://stackoverflow.com/questions/18530975/laravel-4-blade-drop-down-list-class-attribute">Laravel 4 blade drop-down list class attribute</a></p>
  
  <p>I tried this:</p>
  
  <pre><code> {{Form::select('category_id', $categories)}}
  </code></pre>
  
  <p>and the result is:</p>
  
  <pre><code>&lt;select name="category_id"&gt;&lt;option value="0"&gt;{"id":2,"name":"Apartment"}&lt;/option&gt;&lt;option value="1"&gt;{"id":3,"name":"Car"}&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>I couldn't know how to show just the <code>name</code> value of the options. plus I couldn't know how to set the value of each option to its <code>id</code></p>
  
  <p>I know the forth parameter is the option one, and I tried to do this</p>
  
  <pre><code> {{Form::select('category_id', $categories, '', $categories)}}
  </code></pre>
  
  <p>but I got this exception:</p>
  
  <pre><code>htmlentities() expects parameter 1 to be string, array given (View: 
  </code></pre>
  
  <p>please notice that the <code>$categories</code> is array, each row has <code>id</code> <strong>and</strong> <code>name</code> </p>
  
  <h3>Update 1</h3>
  
  <p>I send the value from controller to view like this</p>
  
  <pre><code> $categories = Category::All(['id', 'name']);
  </code></pre>
  
  <p>where <code>Category</code> is a model</p>