undeadline/yandex-weather-laravel

Package for Laravel what use yandex weather api.

v1.0.1 2020-03-14 20:10 UTC

This package is auto-updated.

Last update: 2024-06-18 01:41:49 UTC


README

Yandex weather for Laravel

Installing guide

The recommended way to install YW is through Composer.

composer require undeadline/yandex-weather-laravel

After composer require you need use this command

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