title: show data of nested foreach loop in two different Select Tag in laravel
body: <p>I have two Model(Category,Brand) are relate with one to many relation(hasMany) in laravel, Like <code>category hasMany brands</code>. now i want to display brand data in one select tag and category model data in another select tag.</p>
  
  <ul>
  <li>Here is my Controller code</li>
  </ul>
  
  <pre class="lang-php prettyprint-override"><code>     $category=Category::with('brands')-&gt;get();
        return view('product.add')-&gt;with('category',$category);
  </code></pre>
  
  <ul>
  <li>Here is my view blade.</li>
  </ul>
  
  <pre class="lang-html prettyprint-override"><code>     &lt;div class="form-group"&gt;
         &lt;select name="category_id" class="input"&gt;
           &lt;option value=""&gt;Select Main    Category&lt;/option&gt;
             @foreach($category as $category)
           &lt;option value="{{$category-&gt;id}}"&gt;{{$category-&gt;name}}&lt;/option&gt;
             @endforeach
         &lt;/select&gt;
       &lt;/div&gt;
       &lt;div class="form-group"&gt;
         &lt;select name="brand_id" class="input"&gt;
             @foreach($brands-&gt;brands as $brand)
                &lt;option value="{{$brand-&gt;id}}"&gt;{{$brand-&gt;name}}&lt;/option&gt;
             @endforeach
         &lt;/select&gt;
       &lt;/div&gt;
  </code></pre>
  
  <p>its not working</p>