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

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

rovast/weather
==============

A weather SDK based on Amap

v0.0.1(7y ago)05MITPHP

Since Nov 5Pushed 7y agoCompare

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

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

Weather
=======

[](#weather)

[![Build Status](https://camo.githubusercontent.com/abf9459b7f8a14ff94b7808ec078760bc7ea27cd85b9f9ccf3aabe0ac22aa342/68747470733a2f2f7472617669732d63692e6f72672f726f766173742f776561746865722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rovast/weather)[![StyleCI build status](https://camo.githubusercontent.com/4cb934666081b2d792e52fa3dac23efb5225f62b234c74843ec2ffd7017c9049/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135343634383435332f736869656c64)](https://camo.githubusercontent.com/4cb934666081b2d792e52fa3dac23efb5225f62b234c74843ec2ffd7017c9049/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135343634383435332f736869656c64)

基于[高德开放平台](https://lbs.amap.com/api/webservice/guide/api/weatherinfo/)的天气 API 集成

> 此项目为测试项目，来自 [Laravel-China](https://laravel-china.org) 的 [《PHP 扩展包实战教程 - 从入门到发布》](https://laravel-china.org/courses/creating-package)是个练习项目，请不要用于生产环境

安装
--

[](#安装)

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

使用
--

[](#使用)

```
use Rovast\Weather\Weather;

$key = 'your-api-key';

$weather = new Weather($key);
```

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

[](#在-laravel-中使用)

在 `config/services.php` 中配置

```
'weather' => [
    'key' => env('WEATHER_API_KEY', 'your-api-key'),
],
```

两种方式调用

### 方法参数注入

[](#方法参数注入)

```
public function edit(Weather $weather)
{
    $response = $weather->getWeather('深圳');
}
```

### 服务名访问

[](#服务名访问)

```
public function edit()
{
    $response = app('weather')->getWeather('深圳');
}
```

License
-------

[](#license)

MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2748d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3807d89809b0ce618ecfdef0addc2f6aad81cb2372e556a52df50d5ee42b9a5b?d=identicon)[rovast](/maintainers/rovast)

---

Top Contributors

[![rovast](https://avatars.githubusercontent.com/u/9459488?v=4)](https://github.com/rovast "rovast (23 commits)")

### Embed Badge

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

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

###  Alternatives

[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)
