PHPackages                             gongmeng/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. gongmeng/weather

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

gongmeng/weather
================

A weather SDK

0.0.1(3y ago)06MITPHP

Since Aug 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Gong-Meng/weather)[ Packagist](https://packagist.org/packages/gongmeng/weather)[ RSS](/packages/gongmeng-weather/feed)WikiDiscussions master Synced today

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

 weather
=========

[](#-weather-)

基于高德开放平台的PHP天气信息组件

[![Tests](https://github.com/Gong-Meng/weather/actions/workflows/tests.yml/badge.svg)](https://github.com/Gong-Meng/weather/actions/workflows/tests.yml)[![StyleCI build status](https://camo.githubusercontent.com/ecc06e91afe66d61f6ecfa73ee63028efc365ba755c7cd9299ee1a7980708522/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3533303533343637352f736869656c64)](https://camo.githubusercontent.com/ecc06e91afe66d61f6ecfa73ee63028efc365ba755c7cd9299ee1a7980708522/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3533303533343637352f736869656c64)

Installing
----------

[](#installing)

```
$ composer require gongmeng/weather -vvv
```

Usage
-----

[](#usage)

```
use Overtrue\Weather\Weather;

$key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';

$weather = new Weather($key);

```

获取实时天气
------

[](#获取实时天气)

```
$response = $weather->getLiveWeather('深圳');

```

获取天气预报
------

[](#获取天气预报)

```
$response = $weather->getForecastsWeather('深圳');

```

### 示例

[](#示例)

```
{
    "status": "1",
    "count": "1",
    "info": "OK",
    "infocode": "10000",
    "lives": [
        {
            "province": "广东",
            "city": "深圳市",
            "adcode": "440300",
            "weather": "中雨",
            "temperature": "27",
            "winddirection": "西南",
            "windpower": "5",
            "humidity": "94",
            "reporttime": "2018-08-21 16:00:00"
        }
    ]
}

```

在Laravel中使用
-----------

[](#在laravel中使用)

在 Laravel 中使用也是同样的安装方式，配置写在 config/services.php 中：

```
.
.
.
'weather' => [
    'key' => env('WEATHER_API_KEY'),
],

```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/gongmeng/weather/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/gongmeng/weather/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% 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

Unknown

Total

1

Last Release

1402d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45e2a6b71a5c9508f2b308f640867b103172144ba722ffe6738f2fa5c3c88125?d=identicon)[Gong-Meng](/maintainers/Gong-Meng)

---

Top Contributors

[![Gong-Meng](https://avatars.githubusercontent.com/u/48902072?v=4)](https://github.com/Gong-Meng "Gong-Meng (8 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.0k](/packages/craftcms-cms)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k90](/packages/nativephp-mobile)[illuminate/http

The Illuminate Http package.

11937.9M6.8k](/packages/illuminate-http)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43311.1k](/packages/venturedrake-laravel-crm)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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