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

ActiveLibrary[API Development](/categories/api)

grigorygerasimov/laravel-weather
================================

Laravel package based on WeatherAPI

1.0.0(2y ago)02.0k↓33.3%1[1 PRs](https://github.com/GrigoryGerasimov/laravel-weather/pulls)MITPHPPHP ^8.2

Since Jun 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/GrigoryGerasimov/laravel-weather)[ Packagist](https://packagist.org/packages/grigorygerasimov/laravel-weather)[ RSS](/packages/grigorygerasimov-laravel-weather/feed)WikiDiscussions main Synced 1mo ago

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

Laravel-Weather Package
=======================

[](#laravel-weather-package)

Laravel package for weather and geo info based on WeatherAPI (JSON RestAPI only)

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

[](#installation)

The package can be installed via Composer:

`composer require grigorygerasimov/laravel-weather`

You don't need to register the package Service Provider - this will be done automatically once you install the package.

For publishing the package config please run the following command. There are also some example views and the package docs under the same tag.

`php artisan vendor:publish --tag=laravel-weather`

Start
-----

[](#start)

Once the package is installed and the config is published, you are free to use the package in your Laravel projects.

All you need to do is to use the Weather facade (GrigoryGerasimov\\Weather\\Facades\\Weather) and build custom fluent interfaces, e.g.:

`Weather::api('forecast')->city('Prague')->forecastDays(3)->requireAQI(true)->requireAlerts(true)->requireTides(true)->lang('cs')->get();`

The *api()* method is mandatory, as it configures the relevant api method and api key.

By default the WeatherAPI Free plan key is used, however you can always adjust it in the [laravel-weather config](https://github.com/GrigoryGerasimov/laravel-weather/blob/main/config/weather.php), if you have your own WeatherAPI key.

As for the api methods, the following ones are available.

```
current
forecast
search
history
marine
future
timezone
sports
astronomy
ip

```

By default, the *current* method is used. Please note that the default WeatherAPI Free plan key is limited for the *history* method.

The available Weather facade methods are:

```
api(string $type = 'current')
coords(float|string $lat, float|string $lon)
city(string $city)
zip(string $zipCode)
metar(string $metarCode)
iata(string $iataCode)
autoIp()
ip(string $ip)
forecastDays(int $days = 1)
historyFutureDate(string $date)
historyDate(string $date)
forecastHistoryTimestamp(string|int $timestamp)
historyTimestamp(string|int $timestamp)
forecastHistoryHour(int $hour)
requireAlerts(bool $shouldAlert = false)
requireAQI(bool $ifAqi = false)
requireTides(bool $ifTides = false)
withInterval()
lang(string $langCode)
get()
uri()

```

The facade method *get()* will provide you with the result of your request, however you can also access the request uri directly via the *uri()* method.

For demonstration purpose, the package also includes a number of components and views to the basic Weather api methods. These views are some very simple data lists without any particular styling, they serve merely for the visual representation of the weather and geo info retrieved with the help of this package. You can check them out under the following [web-routes](https://github.com/GrigoryGerasimov/laravel-weather/blob/main/routes/web.php)

For further details, you can also check the weather [controller](https://github.com/GrigoryGerasimov/laravel-weather/blob/main/src/Http/Controllers/WeatherController.php) and [components](https://github.com/GrigoryGerasimov/laravel-weather/tree/main/views/weather/components)

[![Screenshot 2023-06-18 at 11 25 36](https://private-user-images.githubusercontent.com/102112036/246658448-25b6ebc3-63e7-49e4-afc9-5194fb800846.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM4MDAzNjIsIm5iZiI6MTc3MzgwMDA2MiwicGF0aCI6Ii8xMDIxMTIwMzYvMjQ2NjU4NDQ4LTI1YjZlYmMzLTYzZTctNDllNC1hZmM5LTUxOTRmYjgwMDg0Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOFQwMjE0MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zZTNiOTM1NTY1NGU0MjY5MzNkMzAyZGI3OWIwNTcyZjYyNDM4Y2E3MDhiZDExZWExY2ZhODlkMGNkODcxODQ5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Z9F74cCIoqe3e7I04PdRHCyHQTOue8G7udgbovc_ZGo)](https://private-user-images.githubusercontent.com/102112036/246658448-25b6ebc3-63e7-49e4-afc9-5194fb800846.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM4MDAzNjIsIm5iZiI6MTc3MzgwMDA2MiwicGF0aCI6Ii8xMDIxMTIwMzYvMjQ2NjU4NDQ4LTI1YjZlYmMzLTYzZTctNDllNC1hZmM5LTUxOTRmYjgwMDg0Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOFQwMjE0MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zZTNiOTM1NTY1NGU0MjY5MzNkMzAyZGI3OWIwNTcyZjYyNDM4Y2E3MDhiZDExZWExY2ZhODlkMGNkODcxODQ5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Z9F74cCIoqe3e7I04PdRHCyHQTOue8G7udgbovc_ZGo)[![Screenshot 2023-06-18 at 11 26 11](https://private-user-images.githubusercontent.com/102112036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MzBhMmVjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7dxLESH4s8WGzPf1FQDM-0jKSIpevJzlqREx6JyyhIQ)](https://private-user-images.githubusercontent.com/102112036/246658459-f3338866-7e1b-408a-9fa5-b9ce12c262c3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM4MDAzNjIsIm5iZiI6MTc3MzgwMDA2MiwicGF0aCI6Ii8xMDIxMTIwMzYvMjQ2NjU4NDU5LWYzMzM4ODY2LTdlMWItNDA4YS05ZmE1LWI5Y2UxMmMyNjJjMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMxOFQwMjE0MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kMzQ4ZTZiZjAyNGU0MmFkODdiYzgyZDU3ODk2NmRmMDQ1N2M4NmFmNGRlZmIzZjEzYjNkNjUxNmI4MzBhMmVjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.7dxLESH4s8WGzPf1FQDM-0jKSIpevJzlqREx6JyyhIQ)[![Screenshot 2023-06-18 at 11 27 33](https://private-user-images.githubusercontent.com/102112036/246658463-20dc6213-6a98-4def-bfaf-ea1b039b8968.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzM4MDAzNjIsI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9MzAwJlgtQW16LVNpZ25hdHVyZT01Yzk2YmU5OGQyN2FjMjY2YjY3M2JkYmE2OTI5OGEyMTg2NDUyNThiZmYzYzgwZjYwOTlhM2MxMGQzYzg5MjNlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.9h12HvaheZdQP_DYypCC3VXdd8Im82YlyFQ4oSji_-Y)

Documentation
-------------

[](#documentation)

For the detailed infos on the package structure and api, please refer to the [Laravel-Weather documentation](https://github.com/GrigoryGerasimov/laravel-weather/tree/main/docs) which is published into your public folder. While running the php artisan serve command, you can access the docs as follows:

`http://localhost:8000/vendor/laravel-weather/docs/index.html`

Please don't forget to refer to the [official WeatherAPI documentation](https://www.weatherapi.com/docs/) to get a better glimpse of the weather and geo data via a JSON RestAPI.

License
-------

[](#license)

The package is under MIT license, thus you are free to use it in your projects.

Feedback
--------

[](#feedback)

As I've never had any previous experience in creating packages, I would appreciate some feedback: whether the Laravel-Weather package is easy/hard to use, what can be improved etc.

Feel free to get in touch with me under ****

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

1066d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/102112036?v=4)[Grigory](/maintainers/GrigoryGerasimov)[@GrigoryGerasimov](https://github.com/GrigoryGerasimov)

---

Top Contributors

[![GrigoryGerasimov](https://avatars.githubusercontent.com/u/102112036?v=4)](https://github.com/GrigoryGerasimov "GrigoryGerasimov (49 commits)")

---

Tags

geolocationipipsearchlaravelpackagephp8php82php82xweatherweather-apiweather-dataweather-forecast

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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