public static function launchCount($substatistic, $dynamicString) { if ($substatistic === 'Total') { if ($dynamicString === 'currentMonth') { return Cache::remember('stats:description:launchCount:total:currentMonth', 60, function () { return Carbon::now()->format('F Y'); }); } if ($dynamicString === 'totalRockets') { return Cache::remember('stats:description:launchCount:total:totalRockets', 60, function () { return Mission::whereComplete()->count(); }); } } if ($substatistic === 'Falcon 9') { if ($dynamicString === 'launchCount') { return Cache::remember('stats:description:launchCount:falcon9:launchCount', 60, function () { return Mission::whereGenericVehicle('Falcon 9')->whereComplete()->count(); }); } } if ($substatistic === 'Falcon Heavy' || $substatistic === 'Falcon 1') { if ($dynamicString === 'launchCount') { return Cache::remember('stats:description:launchCount:' . $substatistic . ':launchCount', 60, function () use($substatistic) { return Mission::whereSpecificVehicle($substatistic)->whereComplete()->count(); }); } } }