laravel eloquent to array key value

38

Icon::all()->keyBy('name')
$roles = Role::all()->keyBy('name');
$roles = collect(DB::table('roles')->get())->keyBy('name');

Comments

Submit
0 Comments