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

ActiveLibrary

mohamedshuaau/open-weather
==========================

A simple Open Weather API Manager

02PHP

Since Sep 25Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Open Weather
--------------------

[](#laravel-open-weather)

This package manages Open Weather API.

#### Requirements:

[](#requirements)

This package requires Laravel version &gt;= 6.0 and php version &gt;=7.2.

VersionLaravel Version^1.0^6.0
#### Installation:

[](#installation)

Use composer to download the package

```
composer require mohamedshuaau/open-weather

```

Laravel's auto discovery should register the package service provider.

After the installation, you can publish the package content with:

```
php artisan vendor:publish

```

The publish command will publish the configuration file to config folder.

Change the default values of the configuration file (API Key etc).

#### Basic Usage:

[](#basic-usage)

Note: Some of these methods requires a paid account from open weather and will not work as intended.

```
$weather = Weather::getByGeoCoordinates('39.157711', '21.249649')
                    ->getFiveDayWeatherForecast();

return $weather;
```

There are different methods available for different types of data:

```
//In this example, we will get the current weather
Weather::getByGeoCoordinates('39.157711', '21.249649')
         ->getCurrentWeather();

//You can chain different methods of getting the city/state/country information
//in the above example, the geo location is used which accepts lat and long value
```

Available methods to get the city/state/country:

```
//Gets the city by name/state code/country code
//params: city name (required), state code (optional), country code (optional)
Weather::getByCityName('New York', '467', 'US');

//Gets the city information by city id
//params: city id (required)
Weather::getByCityId('2377474');

//Gets the city information by geo location coordinates
//params: latitude (required), longitude (required)
Weather::getByGeoCoordinates('12.434333', '34.434555');

//Gets the city information by zip code
//params: zip code (required), country code (optional)
Weather::getByZipCode('34433', '23434444');
```

Available methods for types of weather:

```
//with each of these methods, it is mandatory to chain a location method. Eg:
//Weather::getByCityId('2377474')->getCurrentWeather();

//Gets the current weather information
Weather::getCurrentWeather();

//Gets the weather information for the last five days with 3 hours difference in between
//params: limit amount (optional)
Weather::getFiveDayWeatherForecast(3);

//Gets sixteen days weather information with per day information
//params: limit amount (optional)
Weather::getSixteenDayWeatherForecast(3);

//Gets the hourly weather forecast data (requires paid account)
//params: limit amount (optional)
Weather::getHourlyWeatherForecast(3);

//Gets thirty day climate forecast data (requires paid account)
//params: limit amount (optional)
Weather::getThirtyDayClimateForecast(3);

//One Call API
//params: exclude (array optional)
Weather::oneCall(['hour', 'daily']);

//Returns historical weather data
//params: limit amount (optional), type (optional), start date (optional|unix date), end date (optional|unix date)
Weather::historicalWeather(3, 'hour', '23124444214', '234234423423');

//Returns current UV
Weather::CurrentUV();

//Returns Forecast UV
//params: limit amount (optional)
Weather::ForecastUV();

//Returns Historical UV
//params: limit amount (optional), start date (optional|unix date), end date (optional|unix date)
Weather::HistoricalUV(3, '23124444214', '234234423423');
```

Aside from the default configurations available in the published config file, you may override the values with method chaining:

```
//lets change the language, units and mode
Weather::language('ja')
         ->units('metric')
         ->mode('html')
         ->getByCityId('2377474')
         ->getCurrentWeather();
```

The unit determines the units in measure and the mode is the return data type.

The available units are:

- metric
- imperial
- standard

By default, the unit is set to standard. The available modes are:

- html
- xml
- json

By default, the mode is set to json. For more information in detail, you may visit [Open Weather API Docs](https://openweathermap.org/api)

More features are to come in the future. This package is open for suggestions and improvements.
You are free to use this package and modify it to your needs.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d70dfe633b6289f6eb6e34dac4d678c53e1464b1b034718d115e29c26987abe?d=identicon)[mohamedshuaau](/maintainers/mohamedshuaau)

---

Top Contributors

[![mohamedshuaau](https://avatars.githubusercontent.com/u/39324930?v=4)](https://github.com/mohamedshuaau "mohamedshuaau (10 commits)")

### Embed Badge

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

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

PHPackages © 2026

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