Akaunting/app/Widgets/LatestIncome.php

21 lines
483 B
PHP
Raw Normal View History

2019-12-29 00:01:19 +00:00
<?php
namespace App\Widgets;
use App\Abstracts\Widget;
use App\Models\Banking\Transaction;
class LatestIncome extends Widget
{
2020-01-15 21:42:20 +00:00
public $default_name = 'widgets.latest_income';
2020-01-10 14:49:31 +00:00
2019-12-29 00:01:19 +00:00
public function show()
{
2020-05-03 08:15:56 +00:00
$transactions = $this->applyFilters(Transaction::with('category')->income()->orderBy('paid_at', 'desc')->isNotTransfer()->take(5))->get();
2019-12-29 00:01:19 +00:00
2019-12-30 23:20:10 +00:00
return $this->view('widgets.latest_income', [
2019-12-29 00:01:19 +00:00
'transactions' => $transactions,
]);
}
}