v2 first commit
This commit is contained in:
33
app/Widgets/LatestIncomes.php
Normal file
33
app/Widgets/LatestIncomes.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Widgets;
|
||||
|
||||
use Arrilot\Widgets\AbstractWidget;
|
||||
use App\Models\Banking\Transaction;
|
||||
|
||||
class LatestIncomes extends AbstractWidget
|
||||
{
|
||||
/**
|
||||
* The configuration array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $config = [
|
||||
'width' => 'col-md-4'
|
||||
];
|
||||
|
||||
/**
|
||||
* Treat this method as a controller action.
|
||||
* Return view() or other content to display.
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
//
|
||||
$latest_incomes = Transaction::type('income')->orderBy('paid_at', 'desc')->isNotTransfer()->take(5)->get();
|
||||
|
||||
return view('widgets.latest_incomes', [
|
||||
'config' => (object) $this->config,
|
||||
'latest_incomes' => $latest_incomes,
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user