2018-01-09 09:53:55 +08:00
|
|
|
<?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
|
2018-01-09 09:53:55 +08:00
|
|
|
{
|
|
|
|
protected $config = [
|
|
|
|
'count' => 5,
|
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
$userRepo = app(UserRepository::class);
|
|
|
|
|
2018-03-12 07:00:42 +08:00
|
|
|
return view('widgets.latest_pilots', [
|
2018-01-09 09:53:55 +08:00
|
|
|
'config' => $this->config,
|
|
|
|
'users' => $userRepo->recent($this->config['count']),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|