title: How to add select_from_array in Backpack for Laravel page/create
body: <p>I want to add a dropdown field picking up an array from config file. I have tried this but getting an error.</p>
  
  <p>In config/gallery.php:</p>
  
  <pre><code>return [
      'column_num' =&gt; [
           ''=&gt;'-- Choose one --', 
           'one' =&gt; 'Category: One column',
           'one-second'=&gt; 'Category: Two columns',
           'one-third'=&gt; 'Category: Three columns',
           'one-fourth'=&gt; 'Category: Four columns',
           'one-fifth'=&gt; 'Category: Five columns',
           'one-sixth'=&gt; 'Category: Six columns',
      ],
  ];
  </code></pre>
  
  <p>In app/PageTemplates.php</p>
  
  <pre><code>...
      $this-&gt;crud-&gt;addField([
                      'name' =&gt; 'column_num',
                      'label' =&gt; 'Number of columns',
                      'type' =&gt; 'select_from_array',
                      'options' =&gt; config('gallery.column_num'),
                      'fake' =&gt; true,
                      'store_in' =&gt; 'extras',
                  ]);
  </code></pre>
  
  <p>====== UPDATE =====</p>
  
  <p>Error:</p>
  
  <blockquote>
    <p>ErrorException in a1e88af9db4bb80b9055323bf64be621df2f9960.php line
    19: Undefined index: value (View:
    /Users/sokada/Code/backpack-ceci/vendor/backpack/crud/src/resources/views/fields/select_from_array.blade.php)
    (View:
    /Users/sokada/Code/backpack-ceci/vendor/backpack/crud/src/resources/views/fields/select_from_array.blade.php)
    (View:
    /Users/sokada/Code/backpack-
    ceci/vendor/backpack/crud/src/resources/views/fields/select_from_array.blade.php)
    in a1e88af9db4bb80b9055323bf64be621df2f9960.php line 19 at
    CompilerEngine->handleViewException(object(ErrorException), '1') in
    PhpEngine.php line 44 at</p>
  </blockquote>
  
  <p>I tried this <a href="https://laravel-backpack.readme.io/docs/crud-fields#section-select_from_array" rel="nofollow noreferrer">as in the doc</a>, but it still gives an error.</p>
  
  <pre><code>$this-&gt;crud-&gt;addField([
      // select_from_array
      'name' =&gt; 'template',
      'label' =&gt; "Template",
      'type' =&gt; 'select_from_array',
      'options' =&gt; [‘one’ =&gt; ‘One’, ‘two’ =&gt; ‘Two’],
      'allows_null' =&gt; false,
      // 'allows_multiple' =&gt; true, // OPTIONAL; needs you to cast this to array in your model;
  ]);
  </code></pre>
  
  <p>Error</p>
  
  <blockquote>
    <p>ErrorException in PageTemplates.php line 114: Use of undefined
    constant ‘one’ - assumed '‘one’' in PageTemplates.php line 114 at
    HandleExceptions->handleError('8', 'Use of undefined constant ‘one’ -
    assumed '‘one’'',
    '/Users/sokada/Code/backpack-ceci/app/PageTemplates.php', '114',
    array()) in PageTemplates.php line 114</p>
  </blockquote>
  
  <p>It is something to do with this if statement.</p>
  
  <pre><code> &lt;option value="{{ $key }}"
      @if ((isset($field['value']) &amp;&amp; $key==$field['value'])
         || ( ! is_null( old($field['name']) ) &amp;&amp; old($field['name']) == $key)
         || (is_array($field['value']) &amp;&amp; in_array($key, $field['value'])) )
          selected
      @endif
   &gt;{{ $value }}&lt;/option&gt;
  </code></pre>