title: Laravel backpack addField where clause
body: <p>Using this <a href="https://github.com/Laravel-Backpack/CRUD/issues/806" rel="nofollow noreferrer">link</a>.</p>
  
  <p>I tried to add a where clause in addField where the dropdown should load the contents as options only if they match a condition.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>$this-&gt;crud-&gt;addField([ // select_from_array
          'name' =&gt; 'manager',
          'label' =&gt; "Manager Name",
          'type' =&gt; 'select_callback', // Custom field type of select2
          'entity' =&gt; 'Manager',
          'attribute' =&gt; 'name',
          'model' =&gt; 'App\Models\Manager',
          'scope' =&gt; 'manager'
          // 'allows_multiple' =&gt; true, // OPTIONAL; needs you to cast this to array in your model;
      ], 'update/create/both'); 
  </code></pre>
  
  <p>And in Model.php</p>
  
  <pre><code>public function scopeManager($query)
  {
      return $query-&gt;where('gym_code', Auth::user()-&gt;gym_code);
  }
  </code></pre>
  
  <p>But it is not working!!
  Thanks</p>