dancelynx / weather
A weather SDK
v1.0
2020-06-20 05:48 UTC
Requires
- guzzlehttp/guzzle: ^6.5
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.2
This package is auto-updated.
Last update: 2025-07-20 18:05:38 UTC
README
一款基于高德地图的天气SDK
Installing
$ composer require dancelynx/weather -vvv
Usage
注册到app中的providers里面
DanceLynx\Weather\ServiceProvider::class,
在config/services.php里添加如下配置:
'weather'=>[ 'key'=>env("WEATHER_API"), ],
然后在.env文件中添加
WEATHER_API=xxxxxx
在代码里可以这样用:
Route::get('/', function () { $result = app('weather')->getWeather('西宁','all'); return response()->json($result); });
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT