akaunting/app/Widgets/LatestIncome.php
2019-12-31 02:20:10 +03:00

24 lines
533 B
PHP

<?php
namespace App\Widgets;
use App\Abstracts\Widget;
use App\Models\Banking\Transaction;
class LatestIncome extends Widget
{
public function show()
{
$transactions = $this->applyFilters(Transaction::with('category')->type('income')->orderBy('paid_at', 'desc')->isNotTransfer()->take(5))->get();
return $this->view('widgets.latest_income', [
'transactions' => $transactions,
]);
}
public function getDefaultName()
{
return trans('widgets.latest_income');
}
}