PHP code example of undeadline / yandex-weather-laravel

1. Go to this page and download the library: Download undeadline/yandex-weather-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

undeadline / yandex-weather-laravel example snippets


$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
bash
php artisan vendor:publish --tag=config