dustycodecorp / laravel-dashboard-tmb-tile
Spatie 的 Laravel 控制面板的 TMB 公交牌块
1.0.0
2020-05-15 15:10 UTC
Requires
- php: ^7.4
- spatie/laravel-dashboard: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-09-16 00:11:13 UTC
README
此牌块可以显示巴塞罗那某个公交站的公交车状态
此牌块可用于 Laravel 控制面板。
安装
您可以通过 composer 安装此包
composer require dustycodecorp/laravel-dashboard-tmb-tile
用法
注意:为了使此牌块正常工作,您需要从 TMB 开发者网站 获取 app_id
和 app_key
,注册过程免费。一旦获得凭证,您可以为任意数量的站点请求信息!。
在 dashboard
配置文件中,您必须在 tiles
键中添加此配置。
// in config/dashboard.php return [ // ... 'tiles' => [ 'tmb' => [ 'app_id' => 'Get this from the TMB developer web stie', 'app_key' => 'Get this from the TMB developer web site', 'refresh_interval_in_seconds' => 60, 'stations' => [ 1103, 1208 ] ] ] ];
在 app\Console\Kernel.php 中,您应安排 Dustycode\TmbTile\ListenForTmbUpdatesCommand
运行。如果您想让它每分钟运行一次,也可以更频繁地运行。如果此牌块的快速更新对仪表板来说不是很重要,您也可以减少运行频率。
// in app/console/Kernel.php
protected function schedule(Schedule $schedule)
{
// ...
$schedule->command(Dustycode\TmbTile\ListenForTmbUpdatesCommand::class)->everyMinute();
}
在您的仪表板视图中,您使用 livewire:tmb-tile
组件。
<x-dashboard> <livewire:tmb-tile position="c1:c2" title="Pl. Catalunya - Portal de l'Àngel" stop-id="1103"/> </x-dashboard>
标题属性是可选的
测试
composer test
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全
如果您发现任何安全相关的问题,请通过 :author_email 发送电子邮件,而不是使用问题跟踪器。
鸣谢
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 了解更多信息。