json([ 'files' => $this->getInstallableFiles()->values(), 'success' => config('app.name') ]); } /** * Get all Nintendo Switch installable files from storage. */ private function getInstallableFiles(): Collection { return collect(Storage::allFiles()) ->filter(fn ($path) => NintendoFileExtension::isSupported($path)) ->map(fn ($path) => [ 'url' => url($path), 'size' => Storage::size($path) ]); } }