Skip to content

Commit

Permalink
Add partner label to category transaction list
Browse files Browse the repository at this point in the history
  • Loading branch information
nafiesl committed Nov 21, 2018
1 parent 8ed588b commit 864cea3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/CategoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private function getCategoryTransactions(Category $category, array $criteria)
$transactionQuery->where('partner_id', $partnerId);
}

return $transactionQuery->latest()->get();
return $transactionQuery->orderBy('date', 'desc')->with('partner')->get();
}

/**
Expand Down
5 changes: 4 additions & 1 deletion resources/views/categories/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
<tr>
<td class="text-center">{{ 1 + $key }}</td>
<td class="text-center">{{ $transaction->date }}</td>
<td>{{ $transaction->description }}</td>
<td>
{{ $transaction->description }}
<span class="pull-right label label-default">{{ optional($transaction->partner)->name }}</span>
</td>
<td class="text-right">{{ $transaction->amount_string }}</td>
<td class="text-center">
@can('update', $transaction)
Expand Down

0 comments on commit 864cea3

Please sign in to comment.