Laravel package for interacting with CoinMarketCap API
PHP 7.1+ and Composer are required.
To get the latest version simply run the code below in your project.
composer require kriosmane/coinmarketcap-api
Once is installed you need to register the service provider. Open up config/app.php
and add the following to the providers
key.
'providers' => [
...
KriosMane\CoinMarketCap\Providers\CoinMarketCapServiceProvider::class,
...
]
Also, register the Facade like so:
'aliases' => [
...
'CoinMarketCapApi' => KriosMane\CoinMarketCap\Facades\CoinMarketCap::class
...
]
You can publish the configuration file using this command:
php artisan vendor:publish --provider="KriosMane\CoinMarketCap\Providers\CoinMarketCapServiceProvider"
A configuration-file named coinmarketcap.php
with default settings will be placed in your config
directory:
You can visit this link to get your CoinMarketCap API key
https://pro.coinmarketcap.com/login/
Open your .env file and add the following in this format. Ensure you must have gotten your api key:
CMC_API_KEY=********-****-****-****-**********
Add the following line to your controller
use \CoinMarketCapApi;
return CoinMarketCapApi::all_cryptos();
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
As a programmer i need coffee to be productive, don't let my cup get emtpy
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!
Thanks! Krios Mane
Please see License File for more information.