Created
February 15, 2017 21:01
-
-
Save holisticnetworking/8f9bdd673b8f81e02a9b3fc108e6d432 to your computer and use it in GitHub Desktop.
See line 19, where the problem lies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( $this->request->query( 'fmt' ) == 'items' ) : | |
$invoices = collection( $invoices )->map( function( $invoice, $key ) use ( $columns ) { | |
// Iterated through line items, rather than invoices: | |
$lis = collection( $invoice->line_items )->map( function( $line_item, $k ) use ( $invoice, $columns ) { | |
$line = []; | |
foreach( $columns as $ckey=>$meta ) : | |
// For line item lists: | |
if( preg_match( '/line_item/i', $meta ) ) : | |
$meta = preg_replace( '/line_item\./i', '', $meta ); | |
$line[] = $line_item->{$meta}; | |
// For invoice lists: | |
else : | |
$line[] = $invoice->{$meta}; | |
endif; | |
endforeach; | |
return $line; | |
} )->toArray(); | |
return $lis; | |
} )->combine( | |
'{n}', | |
function ( $line ) { return $line; } | |
)->toArray(); | |
die( pr( $invoices ) ); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment