Convert recent pilots/pireps to widgets #127
This commit is contained in:
25
app/Widgets/RecentPireps.php
Normal file
25
app/Widgets/RecentPireps.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user