robbens / laravel-dashboard-upsales
Upsales
2.0
2020-09-09 09:51 UTC
Requires
- php: ^7.4
- guzzlehttp/guzzle: ^7.0
- spatie/laravel-dashboard: ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpunit/phpunit: ^9.0
README
Laravel Dashboard 的瓷砖,显示总数据和最新 Upsales 数据。
安装
您可以通过 composer 安装此包
composer require robbens/laravel-dashboard-upsales
用法
在您的仪表盘视图中。
<x-dashboard> <livewire:upsales-total-sales-tile position="a1:b1" /> <livewire:upsales-latest-sales-tile position="a2:b3" limit="15" /> </x-dashboard>
配置 config/dashboard.php
。
如何在 这里 找到生成令牌的方法。
[ // ... 'tiles' => [ 'upsales' => [ 'token' => 'xxxxxxxxxxxx', 'total-sales' => [ 'from-date' => \Carbon\Carbon::now()->firstOfMonth(), // Date in the past to fetch data from. Can be a Carbon instance or days as integer ], 'latest-sales' => [ 'from-date' => \Carbon\Carbon::now()->subDays(30), // Date in the past to fetch data from. Can be a Carbon instance or days as integer ] ], ] ]
在 app/Console/Kernel.php
中安排命令。
protected function schedule(Schedule $schedule) { $schedule->command(\Robbens\UpsalesTile\FetchLatestSalesFromUpsalesCommand::class)->everyMinute(); $schedule->command(\Robbens\UpsalesTile\FetchTotalSalesFromUpsalesCommand::class)->everyMinute(); }
测试
composer test
变更日志
请参阅 CHANGELOG 了解最近更改的更多信息。
贡献
请参阅 CONTRIBUTING 了解详情。
安全
如果您发现任何与安全相关的问题,请通过电子邮件 yo@robin.se 联系,而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。