My LaravelCollective dropdown doesn't return value as expected right now the dropdown looks like this
I want that dropdown just return value from nama
column
This is my Controller
public function create()
{
$supplierList = Supplier::select('idSupplier', 'nama')->get();
return view('transactionsIN.create', compact('supplierList'));
}
and this is my LaravelCollective on blade.php page
{!! Form::select('id_Supplier',$supplierList, null, ['class'=>'form-control', 'placeholder' => 'Pilih salah satu supplier...']) !!}
You need to loop to the array of $supplierList then call
{!! Form::select('id_Supplier',$supplierList->pluck('nama'), null, ['class'=>'form-control', 'placeholder' => 'Pilih salah satu supplier...']) !!}