akaunting/app/Widgets/LatestIncome.php
2019-12-29 03:01:19 +03:00

19 lines
455 B
PHP

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