Hi, in my controllers edit function, I pass my view the following
$csUsers = User::lists('userName', 'id');
And then I can display the users, with the user which was previously selected and saved to the database set as the selected option
{!! Form::select('csManager', $csUsers, Input::old('csUsers'), ['class' => 'csManager']) !!}
However, I need to pass it a list of users with a specific departmentId. If I do
$csUsers = User::select('userName', 'id')->where('departmentId', 3)->get();
My select displays the whole array instead of just the name e.g. {"userName":"Nick", "id":1}
How would I go about getting it to display the name properly?
Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community