Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

tighten/laravelversions

98 stars
1 code files
View tighten/laravelversions on GitHub

app/Console/Commands/FetchLatestReleaseNumbers.php

Open in GitHub
se 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];
})
//
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.