Download the PHP package ilcleme/cryptocurrencies-laravel without Composer
On this page you can find all versions of the php package ilcleme/cryptocurrencies-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ilcleme/cryptocurrencies-laravel
More information about ilcleme/cryptocurrencies-laravel
Files in ilcleme/cryptocurrencies-laravel
Package cryptocurrencies-laravel
Short Description Laravel package for cryptocurrencies api service
License MIT
Informations about the package cryptocurrencies-laravel
Cryptocurrencies API Laravel Manager
Laravel wrapper for the main cryptocurrencies APIs, provides an easy way to use the third-part API. Recover a gateway from the cryptocurrencies Manager and start to query the chosen API.
Requirements
The minimum requirement by Cryptocurrencies API Laravel Manager is Laravel 5.7 installed and your Web server supports PHP 7.1.
Installation
To install Cryptocurrencies API Laravel Manager package you can use a simple composer command.
Publish Vendor
This step is fundamental to use every API calls. After install the package you could publish the config package file, use this command:
Now you can override the default configuration and insert you personal api key for every third-part service.
Architecture
The package contains 3 main objects that have been used to interact with the bees:
- Cryptocurrencies API Manager (
cryptocurrencies.manager
is container alias on Laravel); - Gateways, that is objects implemented to query third-party APIs, everyone have a name used to retrive it from manager;
Available gateways:
- For Cryptocompare there are 4 gateways available "out-of-box", one per section available on Cryptocompare docs:
- Cryptocompare "General Information", for every api calls of "general info" section;
- Cryptocompare "Historical data", for every api calls of "Historical data" section;
- Cryptocompare "Price Data", for every api calls of "price" section;
- Cryptocompare "Top list Data", gateway for every api calls of "top list" section;
- For Coinmarketcap it is only an available gateway, through which it is possible to execute every type of request.
Usage
To use the package simply get the Cryptocurrencies API Manager instance from the container. Get the choosen Gateway based on type of query you want to do, for example to "get price of BTC in fiat currencies" use the Cryptocompare "Price Data". Use the gateway methods with right parameters to query the api. For example:
set a route for this controller and expect to receive a similar response:
To use Coinmarketcap gateway is the same way:
Response expected:
Gateway and API Reference
Here there is full api and gateways reference for Cryptocompare API
Here there is full api and gateways reference for Coinmarketcap API
Test
To run the package test you need to install the dev requirements (test tools) and run phpunit from the package folder
if you want a more verbose log use this command