PHP code example of rovast / weather
1. Go to this page and download the library: Download rovast/weather 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/ */
rovast / weather example snippets
use Rovast\Weather\Weather;
$key = 'your-api-key';
$weather = new Weather($key);
'weather' => [
'key' => env('WEATHER_API_KEY', 'your-api-key'),
],
public function edit(Weather $weather)
{
$response = $weather->getWeather('深圳');
}
public function edit()
{
$response = app('weather')->getWeather('深圳');
}