Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ahinkle/packagist-latest-version

This PHP package provides an easy way to retrieve the latest stable release from composer packages via the Packagist API.
https://github.com/ahinkle/packagist-latest-version

composer packagist packagist-api php

Last synced: 17 days ago
JSON representation

This PHP package provides an easy way to retrieve the latest stable release from composer packages via the Packagist API.

Awesome Lists containing this project

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](https://packagist.org/apidoc). This package was inspired by [this tweet](https://twitter.com/seldaek/status/1240285841492148225) 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:

```bash
composer require ahinkle/packagist-latest-version
```

## Usage

``` php
$client = new \GuzzleHttp\Client();

$packagist = new PackagistLatestVersion($client);

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

### Testing

``` bash
composer test
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Credits

- [Andy Hinkle](https://github.com/ahinkle)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.