PHPackages                             walker-distance/weather - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. walker-distance/weather

ActiveLibrary

walker-distance/weather
=======================

Package description here.

1.0.0(5y ago)06MITPHP

Since Jun 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/walker-distance/weather)[ Packagist](https://packagist.org/packages/walker-distance/weather)[ RSS](/packages/walker-distance-weather/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

 weather
=========

[](#-weather-)

 .

Installing
----------

[](#installing)

```
$ composer require walker-distance/weather -vvv
```

Usage
-----

[](#usage)

发布配置文件

```
php artisan vendor:publish --provider='WalkerDistance\Weather\ServiceProvider'
```

#### 针对laravel5.5版本使用

[](#针对laravel55版本使用)

更新env文件（:API\_KEY 高德对应应用的KEY）

```
WEATHER_API_KEY=*******************
```

使用方法（一）

```
$city = '北京';
$type = 'all'; //可以不填 默认为实时天气  all表示天气预报
$format = 'json'; //默认为json  支持xml(json)
app('weather')->getweather($city, $type = null, $format = null);
```

使用方法（二）

```
//在laravel中使用
protected $weather;

public function __construct(Weather $weather)
{
    $this->weather = $weather;
}

//在方法中使用
public function getWeather(Request $request)
{
    //$city = '北京';
    //$type = 'all'; //可以不填 默认为实时天气  all表示天气预报
    //$format = 'json'; //默认为json  支持xml(json)
    $city = $request->get('city');
    $response = $this->weather->getWeather($city ?: '北京');
    return $this->success($response);
}
```

使用方法（三）

```
//$city = '北京';
//$type = 'all'; //可以不填 默认为实时天气  all表示天气预报
//$format = 'json'; //默认为json  支持xml(json)
$city = '天津';
$key = '';
$weather = new Weather($key);
$response = $weather->getWeather($city,$type = null,$format = null);
```

### 参考

[](#参考)

高德开放平台天气接口

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2156d ago

Major Versions

0.0.1 → 1.0.02020-06-19

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26473707?v=4)[LiYSong](/maintainers/LiYSong)[@liysong](https://github.com/liysong)

---

Top Contributors

[![walker-distance](https://avatars.githubusercontent.com/u/67135082?v=4)](https://github.com/walker-distance "walker-distance (2 commits)")

### Embed Badge

![Health badge](/badges/walker-distance-weather/health.svg)

```
[![Health](https://phpackages.com/badges/walker-distance-weather/health.svg)](https://phpackages.com/packages/walker-distance-weather)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
