PHPackages                             hesunfly/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hesunfly/laravel-weather

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hesunfly/laravel-weather
========================

用户laravel框架的天气查询扩展包

1.0.2(7y ago)02.7kMITPHPCI failing

Since Jan 5Pushed 5y agoCompare

[ Source](https://github.com/hesunfly/laravel-weather)[ Packagist](https://packagist.org/packages/hesunfly/laravel-weather)[ RSS](/packages/hesunfly-laravel-weather/feed)WikiDiscussions master Synced yesterday

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

Weather
-------

[](#weather)

PHP天气查询扩展组件

[![StyleCI build status](https://camo.githubusercontent.com/587445e2152827aec8ff6eea58710b38012a4e044d921e4f5855f98257f9f0b6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136343037363139302f736869656c64)](https://camo.githubusercontent.com/587445e2152827aec8ff6eea58710b38012a4e044d921e4f5855f98257f9f0b6/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136343037363139302f736869656c64)

### 安装

[](#安装)

```
composer require hesunfly/laravel-weather
```

### 使用

[](#使用)

使用前需要在高德地图开放平台申请天气查询接口的key。

发布配置文件：

```
php artsian vendor:publish  --provider="Hesunfly\LaravelWeather\WeatherServiceProvider"
```

config会生成weather.php配置文件，在.env文件中添加 'WEATHER\_KEY'配置型，值为高德开放平台天气查询接口的key。

### 代码示例

[](#代码示例)

基本使用：

1. 获取实时天气：

```
use Hesunfly\Weather\Weather;

$weather = new Weather('高德地图key');

$weather->currenct('城市名称');
```

2. 获取预告天气：

```
use Hesunfly\Weather\Weather;

$weather = new Weather('高德地图key');

$weather->forecast('城市名称');
```

3. 获取xml形式的数据：

```
use Hesunfly\Weather\Weather;

$weather = new Weather('高德地图key');

$weather->currenct('城市名称', 'xml');
```

### License

[](#license)

MIT

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity66

Established project with proven stability

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 ~1 days

Total

5

Last Release

2729d ago

Major Versions

0.0.2 → 1.0.02019-01-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f2634d7ceda148b891d5903bf356c24c30bc86ea6691f3f6806b323a5e8836e?d=identicon)[Hesunfly](/maintainers/Hesunfly)

---

Tags

packagephp

### Embed Badge

![Health badge](/badges/hesunfly-laravel-weather/health.svg)

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751284.3k37](/packages/civicrm-civicrm-core)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[nfse-nacional/nfse-php

This is my package nfse

1523.1k](/packages/nfse-nacional-nfse-php)

PHPackages © 2026

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