承接 victoravelar/laravel-dashboard-exchange-rates-tile 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

victoravelar/laravel-dashboard-exchange-rates-tile

最新稳定版本:v0.2.0

Composer 安装命令:

composer require victoravelar/laravel-dashboard-exchange-rates-tile

包简介

It allows you to display a list of selected currencies and it's exchange rate to a base currency of your choice.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status Total Downloads

It allows you to display a list of selected currencies and it's exchange rate to a base currency of your choice.

This tile can be used on the Laravel Dashboard.

Installation

You can install the package via composer:

composer require VictorAvelar/laravel-dashboard-exchange-rates-tile

Usage

Exchange rates tile

Depending on your provider, this tile will show the most recent exchange rate for the symbols listed in your configuration.

In your dashboard view you use the livewire:dashboard-exchange-rates-tile component.

<x-dashboard>
    <livewire:exchange-rates-tile position="a1" />
</x-dashboard>
Example

Exchange rates example

Exchange rate converter

The conversion of a certain amount in your base currency to each symbol in your configuration is displayed on this tile.

In your dashboard view you use the livewire:dashboard-exchange-converter-tile component.

<x-dashboard>
    <livewire:exchange-converter-tile position="a1" />
</x-dashboard>
Example

Exchange rates example

Fetching exchange rates

In app\Console\Kernel.php you should schedule the Avelar\ExchangeRates\UpdateCurrencyExchangeRatesCommand to run.

// in app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(Avelar\ExchangeRates\UpdateCurrencyExchangeRatesCommand::class)->everyMinute();
}

Customzing the views

php artisan vendor:publish --provider="Avelar\ExchangeRates\ExchangeRatesTileServiceProvider" --tag="dashboard-exchange-rates-views"

Configuration

// in config/dashboard.php

return [
    // other settings
    'tiles' => [
        // other tiles ...
        'exchange_rates' => [
            /*
            |--------------------------------------------------------------------------
            | Exchange rates provider.
            |--------------------------------------------------------------------------
            |
            | Value for the exchange rates provider you prefer to use, the tile was
            | build using exchangerate.host which is free but it is also fully 
            | compatible with fixer.io which has a freemium model.
            |
            | Accepted values are: "exchangerates.host" and "fixer.io".
            |
            */
            'provider' => 'exchangerate.host',

             /*
            |--------------------------------------------------------------------------
            | Base currency.
            |--------------------------------------------------------------------------
            |
            | The currency you want to use as base for the exchange rates display.
            |
            | Any currency is accepted as base as long as it is supported by your
            | exchange rate provider.
            |
            */
            'base' => 'EUR',
            
            /*
            |--------------------------------------------------------------------------
            | Symbols to track.
            |--------------------------------------------------------------------------
            |
            | An array of exchange rate(s) symbols you wish to track.
            |
            | Example: ['USD', 'JPY', 'MXN']
            |
            */
            'symbols' => ['GBP', 'USD'],
            
            /*
            |--------------------------------------------------------------------------
            | Crypto assets to track.
            |--------------------------------------------------------------------------
            |
            | An array of crypto assets(s) you wish to track.
            |
            | The support for this feature depends on the provider you are using and
            | the crypto exchanges/assets this provider tracks.
            |
            | Currently only exchangerates.host is available as crypto provider and 
            | the list of available assets can be found here:
            | https://api.exchangerate.host/cryptocurrencies
            |
            | Example: ['BTC']
            |
            */
            'crypto' => ['BTC'],

            /*
            |--------------------------------------------------------------------------
            | Fixer.io API key.
            |--------------------------------------------------------------------------
            |
            | When using fixer.io as provider you need to privide a valid API key
            | in order to access the API.
            |
            */
            'api_key' => env('FIXER_API_KEY', ''),
            
            /*
            |--------------------------------------------------------------------------
            | Tile refresh interval (optional).
            |--------------------------------------------------------------------------
            |
            | How often should the dashboard refresh your tile.
            |
            | If none set, it defaults to 60s.
            |
            */
            'refresh_interval_in_seconds' => 60,

            /*
            |--------------------------------------------------------------------------
            | Converter value.
            |--------------------------------------------------------------------------
            |
            | An amount to track against the specified symbols and crypto assets.
            |
            | Example: 500
            | 
            | This will display a list in a similar fashion than the one tracking the 
            | exchange rates, the content will refer to the amount in X currency
            | you will get by converting n amount of the base currency.
            |
            */
            'convert_value' => 500,
        ],
    ],
];

Testing

composer test

Security

If you discover any security related issues, please email deltatuts@gmail.com instead of using the issue tracker.

Credits

License

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

统计信息

  • 总下载量: 74
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固