Laravel Map Array

collect($deliver_addresses)->map(function ($address) use ($input) {

    $address['id']              = $input['id'];
    $address['a_new_attribute'] = $input['a_new_attribute'];

    return $address;

});
Shadow