public function getIndex() { $pireps = Pirep::fromAirline()->get(); $failedPireps = Pirep::fromAirline()->where('status', '=', 'failed')->get(); return view('staff.pireps.dashboard', ['pireps' => $pireps, 'failedPireps' => $failedPireps]); }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { // Count airline PIREPs $totalPirepsCount = Pirep::fromAirline()->count(); $view->with('airlinePirepsCount', $totalPirepsCount); }