Skip to content

Instantly share code, notes, and snippets.

@virdignus
Created August 10, 2017 12:18
Show Gist options
  • Save virdignus/03efbac6a5a79fde622aeb7716b491d9 to your computer and use it in GitHub Desktop.
Save virdignus/03efbac6a5a79fde622aeb7716b491d9 to your computer and use it in GitHub Desktop.
public function getUserTransactionsList(User $user)
{
return $user->transactions()
->get()
->each(function ($transaction) {
$transaction['grosses'] = $transaction->gross()->value('name');
$transaction['tags'] = $transaction->tags()->pluck('name');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment