title: how populate select box with database in Laravel 5.4?
body: <p>I have an edit page where the data of a product is passed, on this page I have a select box for the category change, in it I need to insert all the categories registered in my database but only shows the category related to the product of the page.</p>
  
  <p><strong>Select Box of Edit view</strong></p>
  
  <pre><code>&lt;select class="selectpicker" data-live-search="true"&gt;
            @foreach($produtos-&gt;categoria as $categoria)
            &lt;option data-tokens="{{$categoria-&gt;erp_name}}" value="{{$categoria-&gt;erp_categoryid}}"&gt;{{$categoria-&gt;erp_name}}&lt;/option&gt;
            @endforeach
            &lt;/select&gt;
  </code></pre>
  
  <p><strong>ProdutosController</strong></p>
  
  <pre><code>public function edit($id)
      {
          $produtos = Produtos::find($id);
  
          return view('functions.edit')-&gt;with('produtos', $produtos);
      }
  </code></pre>
  
  <p><strong>Routes</strong></p>
  
  <pre><code>Route::get('/product/update/{id}', 'ProdutosController@edit')-&gt;name("product::updateGet");
  Route::post('/product/update/{id}', 'ProdutosController@update')-&gt;name("product::updatePost");
  </code></pre>
  
  <p>Any suggestions?</p>