mardi 21 avril 2020

I want to display the value in the ComboBox in the index file

I want to display the value of the ComboBox in the index file ... but I get an error ... this is on my controller :

$kategori = Kategori::lists('nama','nama');
 return view('barangs.index', compact('kategori'));

and this is in my index file :

  <select name="model" id="model" class="form-control" required>
               <option value="">Select Model</option>
          @foreach($kategori as $Model)
               <option value=""></option>
          @endforeach
 </select>

this error :

ErrorException (E_ERROR)
Undefined variable: kategori (View: D:\NOVA\GIT\UmajeePOS v.2\resources\views\barangs\index.blade.php)
Previous exceptions
Undefined variable: kategori (0)


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire