Monday, March 13, 2017

Laravel: Select2 option value

I have the following code in my view:

{!! Form::select('projectSkills', ['' => ''] + \App\Skill::where('type','freelancer')->pluck('name', 'id')->toArray(), @$skills, ['class' => 'select2','multiple'=>'multiple']) !!}

Where the value of the options comes as 0,1,2,3,4,5, I want the value as a name which is fetching from the table.

What am i doing wrong there ?



via Gamer

Advertisement