phpvms/app/Widgets/LatestPilots.php

30 lines
581 B
PHP
Raw Normal View History

<?php
namespace App\Widgets;
use App\Repositories\UserRepository;
2018-02-21 12:33:09 +08:00
/**
* Show the latest pilots in a view
* @package App\Widgets
*/
2018-01-11 06:05:02 +08:00
class LatestPilots extends BaseWidget
{
protected $config = [
'count' => 5,
];
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function run()
{
$userRepo = app(UserRepository::class);
2018-01-11 06:05:02 +08:00
return $this->view('widgets.latest_pilots', [
'config' => $this->config,
'users' => $userRepo->recent($this->config['count']),
]);
}
}