solitweb / laravel-dashboard-currencies-tile
Laravel Dashboard 的货币瓷砖
1.0.0
2021-05-18 16:21 UTC
Requires
- php: ^7.4|^8.0
- spatie/laravel-dashboard: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.3
README
此瓷砖显示来自 Alpha Vantage 的货币汇率。
此瓷砖可用于 Laravel Dashboard。
安装
您可以通过 composer 安装此包
composer require solitweb/laravel-dashboard-currencies-tile
在仪表板配置文件中,您必须在 tiles 键中添加此配置。
// in config/dashboard.php return [ // ... 'tiles' => [ 'currencies' => [ 'alpha_vantage_apikey' => env('CURRENCIES_ALPHA_VANTAGES_APIKEY'), 'from_currency' => 'BTC', 'to_currency' => 'EUR', 'refresh_interval_in_seconds' => 60, ], ], ];
在 app\Console\Kernel.php
中,您应该安排 Solitweb\CurrenciesTile\FetchDataFromApiCommand
每分钟运行一次。
// in app/console/Kernel.php protected function schedule(Schedule $schedule) { // ... $schedule->command(\Solitweb\CurrenciesTile\FetchDataFromApiCommand::class)->everyMinute(); }
使用方法
在您的仪表板视图中,您使用 livewire:currencies-tile
组件。
<x-dashboard> <livewire:currencies-tile position="a1" title="Currencies" /> </x-dashboard>
自定义视图
如果您想自定义用于渲染此瓷砖的视图,请运行此命令
php artisan vendor:publish --provider="Solitweb\CurrenciesTile\CurrenciesTileServiceProvider" --tag="dashboard-currencies-tile-views"
更新日志
请参阅 更新日志 以获取有关最近更改的更多信息。
贡献
请参阅 贡献 以获取详细信息。
安全
如果您发现任何安全问题,请通过电子邮件 stijn@solitweb.be 联系我们,而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 以获取更多信息。