chimilevschi/laravel-weather
获取天气数据的包
资助包维护!
MichaelNabil230
v2.1.1
2024-08-01 15:45 UTC
Requires
- php: ^8.2
- illuminate/contracts: ^9.0 | ^10.0 | ^11.0
- spatie/laravel-package-tools: ^1.16.4
Requires (Dev)
- larastan/larastan: v2.9.8
- laravel/pint: v1.17.0
- nunomaduro/collision: v8.3.0
- orchestra/testbench: v9.1.2
- pestphp/pest: v2.34.9
- pestphp/pest-plugin-arch: v2.7.0
- pestphp/pest-plugin-laravel: v2.4.0
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan-deprecation-rules: ^1.2.0
- phpstan/phpstan-phpunit: ^1.4.0
This package is auto-updated.
Last update: 2024-10-01 16:14:54 UTC
README
从 OPEN-METEO API (https://open-meteo.com/en)下载气象数据
Open-Meteo 与国家气象服务机构合作,提供11到2公里的开放数据。我们高性能的API为您选择最佳的天气模型,并通过简单的JSON API提供数据。
API对开源开发者和非商业用途免费,无需任何API密钥。您可以直接将它们嵌入到您的应用中。
安装
您可以通过composer安装此包
composer require chimilevschi/laravel-weather
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag="laravel-weather-config"
这是已发布配置文件的内容
return [ 'temperature_unit' => 'celsius', 'wind_speed_unit' => 'kmh', 'precipitation_unit' => 'mm', 'time_format' => 'iso8601', 'timezone' => 'GMT', ];
使用方法
$weather = \Clevada\Weather\Weather::location(30.0812558, 31.2511902) ->current() ->get();
函数
15分钟函数
每小时函数
每日函数
世界气象组织(WMO)的天气解释代码(WW)
测试
composer test
许可
MIT许可(MIT)。请参阅许可文件以获取更多信息。