PHP code example of hesunfly / laravel-weather
1. Go to this page and download the library: Download hesunfly/laravel-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/ */
hesunfly / laravel-weather example snippets
use Hesunfly\Weather\Weather;
$weather = new Weather('高德地图key');
$weather->currenct('城市名称');
use Hesunfly\Weather\Weather;
$weather = new Weather('高德地图key');
$weather->forecast('城市名称');
use Hesunfly\Weather\Weather;
$weather = new Weather('高德地图key');
$weather->currenct('城市名称', 'xml');
shell
php artsian vendor:publish --provider="Hesunfly\LaravelWeather\WeatherServiceProvider"