1. Go to this page and download the library: Download ermakk/laravel-gis-meteo 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/ */
// Получение погоды для города по умолчанию
$weather = Weather::getWeather();
// Получение погоды для конкретного города
$weather = Weather::setCity('Saint Petersburg')->getWeather();
// Очистка кэша
Weather::clearCache('Moscow');
// Получение данных о погоде
$weather = Weather::getWeather();
// Информация о местоположении
echo $weather->location['name']; // Название города
// Текущая погода
$current = $weather->current;
echo $current->temperature_air; // Температура
echo $current->description; // Описание
// Направление ветра как DTO
$windDTO = $current->windDirection;
echo $windDTO->direction; // "северный"
echo $windDTO->shortDirection; // "С"
// Облачность
$cloudinessDTO = $current->cloudinessLabel;
echo $cloudinessDTO->description; // "Ясно", "Малооблачно" и т.д.
// Тип осадков
$precipitationTypeDTO = $current->precipitationType;
echo $precipitationTypeDTO->type; // "Дождь", "Снег" и т.д.
echo $precipitationTypeDTO->symbol; // Эмодзи символ
// Интенсивность осадков
$precipitationIntensityDTO = $current->precipitationIntensity;
echo $precipitationIntensityDTO->intensity; // "Небольшой дождь/снег"
echo $precipitationIntensityDTO->recommendation; // Рекомендации