Fix saving PIREPs as draft

This commit is contained in:
Nabeel Shahzad
2018-05-29 11:04:28 -05:00
parent e02ae682a8
commit d76b264238
12 changed files with 125 additions and 56 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Widgets;
use App\Interfaces\Widget;
use App\Models\Enums\PirepState;
use App\Repositories\PirepRepository;
/**
@@ -22,9 +23,17 @@ class LatestPireps extends Widget
{
$pirepRepo = app(PirepRepository::class);
$pireps = $pirepRepo
->whereNotInOrder('state', [
PirepState::CANCELLED,
PirepState::DRAFT,
PirepState::IN_PROGRESS
], 'created_at', 'desc')
->recent($this->config['count']);
return view('widgets.latest_pireps', [
'config' => $this->config,
'pireps' => $pirepRepo->recent($this->config['count']),
'pireps' => $pireps,
]);
}
}