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 index
s not changed.
Comments
Post a Comment