kriosmane/coinmarketcap-api
Composer 安装命令:
composer require kriosmane/coinmarketcap-api
包简介
Laravel package for interacting with CoinMarketCap API
README 文档
README
A Laravel package for interacting with the CoinMarketCap API.
🚀 Installation
Laravel 11 requires PHP 8.1+ and Composer.
To install the latest version, run:
composer require kriosmane/coinmarketcap-api
📌 Service Provider & Facade (Not Required for Laravel 11)
From Laravel 11, service providers and facades are auto-discovered. However, if you need to register them manually, add the following to your config/app.php file:
Service Provider (Only if required)
'providers' => [ KriosMane\CoinMarketCap\Providers\CoinMarketCapServiceProvider::class, ],
Facade (Only if required)
'aliases' => [ 'CoinMarketCapApi' => KriosMane\CoinMarketCap\Facades\CoinMarketCap::class, ],
⚙️ Configuration
Publish the configuration file using:
php artisan vendor:publish --provider="KriosMane\CoinMarketCap\Providers\CoinMarketCapServiceProvider"
This will create a coinmarketcap.php file in your config directory.
Get your CoinMarketCap API Key from:
Then, add the key to your .env file:
CMC_API_KEY=your-api-key-here
📖 Usage
You can start using the API in your controllers or services:
use CoinMarketCap; // Get latest cryptocurrency listings $cryptos = CoinMarketCap::listCryptos(); // Get latest market quotes for a specific cryptocurrency $quotes = CoinMarketCap::getQuotes(['symbol' => 'BTC,ETH']);
🤝 Contributing
Feel free to fork this repository and submit a pull request to enhance its functionality.
☕ How can I thank you?
If you found this package helpful, consider buying me a coffee!
☕ Buy me a coffee
⭐ Star the repo, share it on Twitter, or post about it on HackerNews. Spread the word!
Thank you!
Krios Mane
📜 License
Please see License File for more information.
统计信息
- 总下载量: 1.17k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-01-18