VictorAvelar / laravel-dashboard-football-data-advanced
Laravel仪表板瓷砖,用于显示比赛、结果、排名以及更多足球数据统计。
v0.1.0
2022-10-06 21:35 UTC
Requires
- php: ^8.0|^7.4
- spatie/laravel-dashboard: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.3
- squizlabs/php_codesniffer: ^3.6.2
This package is auto-updated.
Last update: 2024-09-07 02:01:16 UTC
README
Laravel仪表板瓷砖,用于显示比赛、结果、排名以及更多足球数据统计。
此瓷砖可用于Laravel仪表板。
安装
您可以通过Composer安装此包
composer require victoravelar/laravel-dashboard-football-data-advanced
配置
// in config/dashboard.php return [ // other settings 'tiles' => [ // other tiles ... 'football_data_advanced' => [ /* |-------------------------------------------------------------------------- | Football-data.org API KEY |-------------------------------------------------------------------------- | | In order to fetch the data an API key is required, get yours at | https://www.football-data.org/client/register. | The API is provided in a FREMIUM model thus the information to be | displayed is limited by your own API plan. | */ 'api_key' => env('FOOTBALL_DATA_API_KEY', ''), /* |-------------------------------------------------------------------------- | Future lookup limit. |-------------------------------------------------------------------------- | | Sets the limit to look forward for upcoming matches, the max. suggested | value is 1 week as the space for displaying is limited and most of the | values will not fit the available tile space. | | The value must be a strtotime valid string without sign. | | See: https://php.ac.cn/manual/en/function.strtotime.php | */ 'future' => '2 days', /* |-------------------------------------------------------------------------- | Past lookup limit. |-------------------------------------------------------------------------- | | Sets the limit to look backwards for resutls, the max. suggested | value is 1 week as the space for displaying is limited and most of the | values will not fit the available tile space. | | The value must be a strtotime valid string without sign. | | See: https://php.ac.cn/manual/en/function.strtotime.php | */ 'past' => '3 days', /* |-------------------------------------------------------------------------- | Competitions of interest. |-------------------------------------------------------------------------- | | The list of competitions that you are interested in. | | The values for all the competitions can be found here: | https://docs.football-data.org/general/v4/lookup_tables.html#_league_codes | | The leagues available in the free tier are the following: Champions League, | Primeira Liga, Premier League, Eredivisie, Bundesliga, Ligue 1, Serie A, | La Liga, Championship, Serie A BR, Worldcup, Euro. | */ 'competitions' => ['PD', 'PL', 'FL1', 'BL1', 'CL', 'SA'], /* |-------------------------------------------------------------------------- | Priority Football teams. |-------------------------------------------------------------------------- | | A list of the teams you consider a priority across the tracked competitions. | | You must use the team acronym, ex. use `PSG` for Paris St. Germain. | */ 'priority' => [ 'FCB', 'MCI', 'LIV', 'PSG', 'RBL', ], ], ], ];
使用
此包包含多个瓷砖,用于显示来自Football-data.org的信息,使用方式将按瓷砖分拆。
即将到来的比赛
此瓷砖显示您在dashboard.tiles.football_data_advanced.competitions
中选择的联赛的即将到来的足球比赛。
在您的仪表板视图中,您使用livewire:fda-upcoming
组件。
<x-dashboard> <livewire:fda-upcoming position="a1" /> </x-dashboard>
示例
比赛结果
此瓷砖显示您在dashboard.tiles.football_data_advanced.competitions
中选择的联赛的足球比赛结果。
在您的仪表板视图中,您使用livewire:fda-results
组件。
<x-dashboard> <livewire:fda-results position="a1" /> </x-dashboard>
示例
联赛排名
此瓷砖显示您选择的某个联赛的排名,您需要使用联赛代码作为组件的参数。
在您的仪表板视图中,您使用livewire:fda-results
组件。
<x-dashboard> <livewire:fda-standings position="a1" competition="PL"/> </x-dashboard>
示例
示例仪表板
<x-dashboard> <livewire:fda-standings position="a1" competition="PL"/> <livewire:fda-results position="b1" /> <livewire:fda-upcoming position="c1"/> </x-dashboard>
截图
测试
composer test
变更日志
有关最近更改的更多信息,请参阅变更日志。
贡献
有关详细信息,请参阅贡献指南。
安全
如果您发现任何与安全相关的问题,请通过电子邮件deltatuts@gmail.com联系,而不是使用问题跟踪器。
致谢
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。