/orin

Discogs PHP Client

Primary LanguagePHPMIT LicenseMIT

Discogs PHP Client

Packagist Version Tests Check & fix styling Psalm Total Downloads Packagist PHP Version Support

Orin is a Discogs API PHP client library which utilizes GuzzleHttp.

📚 Documentation

Installation

You can install the package via composer:

composer require xyrotech/orin

Requirements

PHP >= 7.4

Usage

Copy the config file.

Plain PHP

cp vendor/xyrotech/orin/config/orin.php myconfig

Laravel

php artisan vendor:publish --provider="Xyrotech\OrinServiceProvider" --tag="orin-config"
$config = include('orin.php');

$discog = new Xyrotech\Orin($config);

$artist = $discog->artist(45);

echo $artist->name;

Output

'Aphex Twin'

This library follows the API Documentation heavily. All endpoints have a corresponding methods. i.e. All Label Release would have the equivalent method below

$config = include('orin_config.php');

$discog = new Xyrotech\Orin($config);

$label = $discog->all_label_releases(1);

var_dump($label->releases); // An array of label releases

Testing

Clone the repository and install dependencies:

git clone https://github.com/xyrotech/orin.git && composer install

Create your own config.php based on /tests/configs/config.test.php with your own authentication. Be sure to change the username at the bottom of the config to match the account information.

composer test

Orders may not work properly as it would require you to create a listing and buy it using another account to push the order to the "SOLD" status.

composer format
composer psalm

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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