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)


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RZqwvf
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time