-
app/Console/Commands/FetchLatestReleaseNumbers.php
Open in GitHubse Illuminate\Console\Command; class FetchLatestReleaseNumbers extends Command { // public function handle() { Log::info('Syncing Laravel Versions'); $this->fetchVersionsFromGitHub() // Map into arrays containing major, minor, and patch numbers ->map(function ($item) { $pieces = explode('.', ltrim($item['name'], 'v')); return [ 'major' => $pieces[0], 'minor' => $pieces[1], 'patch' => $pieces[2] ?? null, ]; }) // Map into groups by release; pre-6, major/minor pair; post-6, major ->mapToGroups(function ($item) { if ($item['major'] < 6) { return [$item['major'] . '.' . $item['minor'] => $item]; } return [$item['major'] => $item]; }) // } // }