I can take the list using
$specialities = Speciality::pluck('name','id')
Why isn't the following code working? What could be an alternative?
I am returning this array by ajax to form a select box. So I thought pluck
(list in laravel 4+) would be the right choice.
$specialities = Speciality::pluck('name','id')->where('role_id',$request->roleid);