phpvms/app/Widgets/RecentPireps.php
2018-01-08 19:53:55 -06:00

26 lines
518 B
PHP

<?php
namespace App\Widgets;
use App\Repositories\PirepRepository;
class RecentPireps extends BaseWidget
{
protected $config = [
'count' => 5,
];
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function run()
{
$pirepRepo = app(PirepRepository::class);
return $this->view('widgets.recent_pireps', [
'config' => $this->config,
'pireps' => $pirepRepo->recent($this->config['count']),
]);
}
}