Laravel Collection Public API: keyBy
…allback function like so: 1 <?php 2 3 $ results = $ people -> keyBy ( function ( $ item ) { 4 return $ item [ ' id ' ] ; 5 } ) ; However, the above example is overly complicated if all we were interested in was just the id of the person. We could...