echo Form::select(
'campaign_user_id',
User::find(1)->profile->lists('first_name', 'id'),
Input::get('campaign_user_id', $campaign->user_id),
array(
"placeholder" => "US",
'class' => 'form-control',
'disabled' => 'disabled'
)
)
The above code is used to create a dropdown select list. It retrieves the list of users from the database. In line 3 you can seeUser::find(1)->profile->lists('first_name', 'id')
It gets the first_name column, I need to somehow get the columns of the first and last name and combine them in this list. Thus, the list value is still the user ID and the full name is displayed.
Any idea how to make this work with 2 DB columns first_nameand last_name? Or another way to reach my ultimate goal?
source
share