/** * @param $substatistic * @return string */ public static function kwajalein($substatistic) { if ($substatistic === 'Launches') { return Cache::remember('stats:kwajalein:launches', 60, function () { return Mission::whereComplete()->whereHas('launchSite', function ($q) { $q->where('name', 'Omelek Island'); })->count(); }); } else { if ($substatistic === 'Last Launch') { try { $lastLaunch = Mission::lastFromLaunchSite('Omelek Island')->firstOrFail(); } catch (ModelNotFoundException $e) { return false; } return $lastLaunch; } } }