i want to show the database values in drop down..i tried a lot but it's not working for me.. i am getting errors i don't know where i mistaken..i am new to laravel..please help me where i mistaken..
view:
<div class="form-group">
<label for="name" class="col-md-4 control-label">User type</label>
<div class="col-md-6">
<?php
{!!Form::select('user_type_id[]', $usertypes_list, $thing->user_type->pluck('id'), ['class' => 'form-control'])!!}
;?>
</div>
Controller:
public function get() {
$usertypes_list = User_type::lists('id', 'type');
return view('edit')->compact('user_type');
}
Can anyone help me... Thanks in advance.
run
composer require "laravelcollective/html":"^5.4"
to addlaravelcollective
to your project asForm::select
is no longer available in laravel 5+and have a quick look on this laravelcollective Doc.s
Edit: in your controller you've to pass
$usertypes_list
so the function should bethen your view should looks like: