1. Go to this page and download the library: Download lukundo/weather-client 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/ */
lukundo / weather-client example snippets
$client = new WeatherClient('your_api_key');
use Lukundo\WeatherClient;
$client = new WeatherClient('your_api_key');
$weather = $client->getWeather('Ndola');
print_r($weather);
use Lukundo\WeatherClient;
public function showWeather()
{
$client = new WeatherClient('your_api_key');
$data['weather'] = $client->getWeather('Ndola');
return view('weather_view', $data);
}