title: using laravel option from javascript
body: <p>in controller I do this</p>
  
  <pre><code>$actions = array('' =&gt; 'Select Action Name') + Action::lists('name' , 'id');
  </code></pre>
  
  <p>I want to use that <code>$actions</code> variable in my javascript.</p>
  
  <p>I tried these ways:</p>
  
  <pre><code>&lt;script&gt;
  var actions = {{actions}};
  &lt;/script&gt;
  </code></pre>
  
  <p>but I got this excpetion</p>
  
  <pre><code>Array to string conversion
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>&lt;script&gt;
      @foreach($actions as $action)
          console.log($action);
      @endforeach
  &lt;/script&gt;
  </code></pre>
  
  <p>but in the console I got this exception</p>
  
  <pre><code>Uncaught ReferenceError: $action is not defined 
  </code></pre>
  
  <p>could you help me please?</p>