undeadline / yandex-weather-laravel
Laravel使用的Yandex天气API的包。
v1.0.1
2020-03-14 20:10 UTC
Requires
- php: >=7.2
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- orchestra/testbench: ^5.1
- phpunit/phpunit: 9.*
This package is auto-updated.
Last update: 2024-09-18 02:14:28 UTC
README
安装指南
推荐通过Composer安装YW。
composer require undeadline/yandex-weather-laravel
在执行composer require后,需要使用以下命令
php artisan vendor:publish --tag=config
$latitude = 15.8921; $longitude = 82.78821; $params = [ 'lang' => 'ru_RU', // response language 'limit' => 1, // forecast period 'hours' => true, // response is contains horly period 'extra' => true // detailed precipitation forecast ]; $weather = new \Undeadline\YW\YandexWeather($latitude, $longitude, $params); echo $weather->temperature(); // current temperature echo $weather->feelsTemperature(); // current feels temperature echo $weather->icon(); // url for temperature icon