php - Laravel select form default value -


i'm having problem on setting default value of "please select" on select form laravel. here comes code.

$user = \app\user::where('role_id','=','3')->orderby('name', 'asc')->lists('name','staff_id'); 

and here's on blade

{!! form::select('requestby', $user, input::old('requestby'), array('class' => 'form-control')) !!} 

i have tried put array_merge seems overwriting <option> value staff_id index value. should now?

array_merge re-index array when merging. can use + -

$user = array('' => 'please select') + $user; 

the indexs not changed.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -