Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel eloquent to array key value

$roles = collect(DB::table('roles')->get())->keyBy('name');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #eloquent #array #key
ADD COMMENT
Topic
Name
8+7 =