I am using Laravel 5.3 along with Twig templating engine (Not Blade). I am trying to generate a list of drop-down list in the form. Instead of showing just the values. It is showing the keys as well.
For example:
{"display_name":"Admin"}
In my view the code is
{{ form_select('roles', roles, input_get('role'), {id:'user_type',class:'form-control'}) }}
In the controller
public function create()
{
$roles = Role::all('display_name');
return view('users.user-add')->with(['roles' => $roles]);
}
What am I missing?