ahinkle/packagist-latest-version

Obtains the latest version release of Composer Packages from the Packagist API

2.1.0 2022-12-09 21:06 UTC

This package is auto-updated.

Last update: 2024-11-10 01:19:05 UTC


README

Build Status Latest Stable Version Style CI Total Downloads License

Composer Packagist Latest Version

This package provides an easy way to retrieve the latest stable release from composer packages via the Packagist API. This package was inspired by this tweet after discovering that it's not possible to retrieve the latest non-development tagged release.

This package will return the highest tagged non-developmental release. e.g. When there is a 2.1.0 release then a new 1.2.1 release is posted, this will continue to show that 2.1.0 is still the latest version.

Installation

You can install the package via composer:

composer require ahinkle/packagist-latest-version

Usage

$client = new \GuzzleHttp\Client();

$packagist = new PackagistLatestVersion($client);

$packagist->getLatestRelease('laravel/framework');

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email ahinkle10@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.