title: How to fetch dropdown dynamic value using laravel 5.4.6
body: <p>i have a problem to get value from dropdown using laravel please tell me i am new to the laravel.</p>
  
  <p>Blade code: </p>
  
  <pre><code>&lt;form method="POST" action="{{url('/add_sub_cat')}}" enctype="multipart/form-data"&gt;
      &lt;input type="hidden" name="_token" value="{{ csrf_token() }}"&gt;
      &lt;div class="form-group"&gt;
      &lt;label for="cat"&gt;Category&lt;/label&gt;
        &lt;select class="form-control"&gt;
          @foreach($categories as $cat)
          &lt;option id="categoryId" value="{{$cat-&gt;id}}" selected="selected"&gt;{{ $cat-&gt;category }}&lt;/option&gt;
          @endforeach
        &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
        &lt;label for="sub"&gt;Sub Category&lt;/label&gt;
        &lt;input type="text" class="form-control" name="subcategory" id="" {{ old('subcategory') }}&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
         &lt;button type="submit" class="btn btn-default"&gt;Create&lt;/button&gt;
         &lt;a href="{{url('/subcategory')}}" class="btn btn-default"&gt;Cancel&lt;/a&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>