title: How to build conditional list of dropdown options in Laravel Voyager
body: <p>I have a problem with Laravel Voyager v1.2. I need to filter list of related list of options in select dropdown easily by where condition. So let's say I have Post with relation to Category, but I don't want to list all Categories in select dropdown, but just that active ones.</p>
  
  <ol>
  <li>I tried to force Voyager to take my own method to build an relationship in Post model:</li>
  </ol>
  
  <pre><code>public function category_id() {
    return $this-&gt;belongsTo('Post::class')-&gt;where('active',1);
  }
  </code></pre>
  
  <ol start="2">
  <li>Also tried to define scope in BREAD JSON options for the category field:</li>
  </ol>
  
  <pre><code>{
      "relationship": {
          "key": "id",
          "label": "name",
          "scopes": [
              "active"
          ]
      }
  }
  </code></pre>
  
  <p><strong>Post Model part:</strong></p>
  
  <pre><code>public function scopeActive($query) {
    return $query-&gt;where('active', 1);
  }
  </code></pre>
  
  <p>This is how my Post class look like (I don't actualy need to filter active categories, but food categories by it's IDs):</p>
  
  <pre><code>public function soup1() {
    return $this-&gt;belongsTo('App\Meal')-&gt;where('meal_category_id',1);
  }
  
  
  public function soup2() {
    return $this-&gt;belongsTo('App\Meal')-&gt;where('meal_category_id',1);
  }
  
  public function mealy() {
    return $this-&gt;belongsTo('App\Meal')-&gt;where('meal_category_id',7);
  }
  
  public function scopeSoups($query)
  {
    return $query-&gt;where('meal_category_id', 1);
  }
  
  public function scopeMealy($query)
  {
    return $query-&gt;where('meal_category_id', 7);
  }
  </code></pre>
  
  <p>I want to receive filtered list of options instead of all model rows.</p>