phpvms/app/Widgets/LatestPilots.php
2018-03-19 20:50:40 -05:00

31 lines
598 B
PHP

<?php
namespace App\Widgets;
use App\Interfaces\Widget;
use App\Repositories\UserRepository;
/**
* Show the latest pilots in a view
* @package App\Widgets
*/
class LatestPilots extends Widget
{
protected $config = [
'count' => 5,
];
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function run()
{
$userRepo = app(UserRepository::class);
return view('widgets.latest_pilots', [
'config' => $this->config,
'users' => $userRepo->recent($this->config['count']),
]);
}
}