Skip to content

Instantly share code, notes, and snippets.

@mergeweb
Created December 11, 2015 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mergeweb/0a50e44cf174a07d7b2c to your computer and use it in GitHub Desktop.
Save mergeweb/0a50e44cf174a07d7b2c to your computer and use it in GitHub Desktop.
<?php
public function live_table_reduce($columns, $listing)
{
foreach($listing->toArray() as $key=>$value){
if(is_array($value) && !empty($value['label'])){
$value = $value['label'];
}
$columns[$key]['data'][] = $value;
$columns[$key]['value'] = Inflector::humanize($key);
}
return $columns;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment