PHPackages                             meteoflow/laravel - 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. [API Development](/categories/api)
4. /
5. meteoflow/laravel

ActiveLibrary[API Development](/categories/api)

meteoflow/laravel
=================

Laravel integration for MeteoFlow Weather API SDK

1.2.0(2mo ago)035MITPHPPHP ^7.1|^8.0

Since Feb 6Pushed 2mo agoCompare

[ Source](https://github.com/MeteoFlow/laravel)[ Packagist](https://packagist.org/packages/meteoflow/laravel)[ Docs](https://github.com/meteoflow/laravel)[ RSS](/packages/meteoflow-laravel/feed)WikiDiscussions master Synced 1mo ago

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

MeteoFlow Laravel
=================

[](#meteoflow-laravel)

Laravel integration for the MeteoFlow Weather API SDK.

Requirements
------------

[](#requirements)

- PHP 7.1+
- Laravel 5.5 - 12.x

Installation
------------

[](#installation)

```
composer require meteoflow/laravel
```

The package uses Laravel's auto-discovery, so the service provider and facade will be registered automatically.

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=meteoflow-config
```

Add your API key to your `.env` file:

```
METEOFLOW_API_KEY=your-api-key-here
```

### Available Configuration Options

[](#available-configuration-options)

OptionEnvironment VariableDefault`api_key``METEOFLOW_API_KEY`(required)`base_url``METEOFLOW_BASE_URL``https://api.meteoflow.com``timeout``METEOFLOW_TIMEOUT``10``connect_timeout``METEOFLOW_CONNECT_TIMEOUT``5``debug``METEOFLOW_DEBUG``false`Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use MeteoFlow\Laravel\Facades\MeteoFlow;
use MeteoFlow\Location\LocationSlug;
use MeteoFlow\Location\LocationCoords;
use MeteoFlow\Location\Location;

// Get current weather by location slug
$location = new LocationSlug('london-gb');
$weather = MeteoFlow::current($location);

echo $weather->getWeather()->getTemperature(); // 15.5
echo $weather->getWeather()->getDescription(); // "Partly cloudy"

// Get current weather by coordinates
$location = new LocationCoords(51.5074, -0.1278);
$weather = MeteoFlow::current($location);

// Get current weather by IP
$location = Location::fromIp('8.8.8.8');
$weather = MeteoFlow::current($location);

// Get daily forecast
$forecast = MeteoFlow::forecastDaily($location);

foreach ($forecast->getForecasts() as $day) {
    echo $day->getDate() . ': ' . $day->getTemperatureMax() . '°C';
}
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use MeteoFlow\WeatherClientInterface;
use MeteoFlow\Location\LocationSlug;

class WeatherController extends Controller
{
    public function show(WeatherClientInterface $client)
    {
        $location = new LocationSlug('london-gb');
        $weather = $client->current($location);

        return view('weather', [
            'temperature' => $weather->getWeather()->getTemperature(),
            'description' => $weather->getWeather()->getDescription(),
        ]);
    }
}
```

### Available Methods

[](#available-methods)

#### Weather

[](#weather)

```
// Current weather
MeteoFlow::current(Location $location): CurrentWeatherResponse

// Hourly forecast
MeteoFlow::forecastHourly(Location $location, ?ForecastOptions $options = null): HourlyForecastResponse

// 3-hourly forecast
MeteoFlow::forecast3Hourly(Location $location, ?ForecastOptions $options = null): ThreeHourlyForecastResponse

// Daily forecast
MeteoFlow::forecastDaily(Location $location, ?ForecastOptions $options = null): DailyForecastResponse

// Geomagnetic activity
MeteoFlow::geomagnetic(Location $location): GeomagneticResponse

// Air quality by days
MeteoFlow::airQuality(Location $location, ?AirQualityOptions $options = null): AirQualityResponse
```

#### Geography

[](#geography)

```
// List all supported countries
MeteoFlow::countries(): CountriesResponse

// List cities for a country code
MeteoFlow::citiesByCountry(string $countryCode): CitiesResponse

// Search cities by name (limit is optional)
MeteoFlow::searchCities(string $query, ?int $limit = null): CitiesResponse
```

### Geography

[](#geography-1)

```
use MeteoFlow\Laravel\Facades\MeteoFlow;

// List all countries
$response = MeteoFlow::countries();

foreach ($response->countries as $country) {
    $country->slug;  // e.g. "united-kingdom"
    $country->name;  // e.g. "United Kingdom"
    $country->code;  // ISO 3166-1 alpha-2, e.g. "GB"
}

// Cities by country code
$response = MeteoFlow::citiesByCountry('DE');

foreach ($response->cities as $city) {
    $city->slug;           // e.g. "germany-berlin"
    $city->name;           // City name
    $city->country;        // Country name
    $city->countryCode;    // Country code
    $city->region;         // Region / state name
    $city->lat;            // Latitude
    $city->lon;            // Longitude
    $city->timezoneOffset; // UTC offset in minutes
}

// Search cities by name
$response = MeteoFlow::searchCities('Berlin', 5);

foreach ($response->cities as $city) {
    // Same fields as above
}
```

### Forecast Options

[](#forecast-options)

```
use MeteoFlow\Options\ForecastOptions;
use MeteoFlow\Options\Unit;

$options = ForecastOptions::create()
    ->setDays(14)
    ->setUnit(Unit::IMPERIAL)
    ->setLang('de');

$forecast = MeteoFlow::forecastDaily($location, $options);
```

### Air Quality Options

[](#air-quality-options)

```
use MeteoFlow\Options\AirQualityOptions;
use MeteoFlow\Options\Unit;

$options = AirQualityOptions::create()
    ->setDays(5)
    ->setUnit(Unit::METRIC);

$airQuality = MeteoFlow::airQuality($location, $options);
```

### Geomagnetic Activity

[](#geomagnetic-activity)

```
use MeteoFlow\Location\Location;

$location = Location::fromSlug('united-kingdom-london');
$geomagnetic = MeteoFlow::geomagnetic($location);
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for more information.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance83

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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 ~7 days

Total

3

Last Release

86d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b75ba7ab1b0af4dcfb87137d520dfae8074e0f7ceb50964145891ee34a8ac592?d=identicon)[my-meteoflow](/maintainers/my-meteoflow)

---

Top Contributors

[![my-meteoflow](https://avatars.githubusercontent.com/u/257248064?v=4)](https://github.com/my-meteoflow "my-meteoflow (5 commits)")[![iusik](https://avatars.githubusercontent.com/u/653759?v=4)](https://github.com/iusik "iusik (1 commits)")

---

Tags

apilaravelsdkweatherforecastmeteoflow

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[orzcc/taobao-top-client

Taobao top client(SDK) for laravel

11125.9k](/packages/orzcc-taobao-top-client)[missael-anda/laravel-whatsapp

A Whatsapp Business Cloud API wrapper for Laravel.

677.5k](/packages/missael-anda-laravel-whatsapp)

PHPackages © 2026

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