Skip to content

Instantly share code, notes, and snippets.

@oomusou
Created September 29, 2017 03:23
Show Gist options
  • Save oomusou/c13d3573bc7717dd8ceec6873b31783f to your computer and use it in GitHub Desktop.
Save oomusou/c13d3573bc7717dd8ceec6873b31783f to your computer and use it in GitHub Desktop.
$formattedList = collect($list)
->map(function ($item) {
return $this->formatTimestamp($item, 'createDate', self::PATTERN_TIME);
})
->map(function ($item) {
return $this->formatTimestamp($item, 'activeDate', self::PATTERN_DATE);
})
->map(function ($item) {
return $this->formatNumber($item, self::ACTIVE_AMOUNT);
})
->map(function ($item) {
return $this->formatNumber($item, self::INACTIVE_AMOUNT);
})
->map(function ($item) {
return $this->transformZero($item, self::ACTIVE_AMOUNT);
})
->map(function ($item) {
return $this->transformZero($item, self::INACTIVE_AMOUNT);
})
->toArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment