chimilevschi / laravel-weather
Package for get the weather data
Fund package maintenance!
MichaelNabil230
Requires
- php: ^8.2
- illuminate/contracts: ^9.0 | ^10.0 | ^11.0
- spatie/laravel-package-tools: ^1.16.4
Requires (Dev)
- larastan/larastan: v2.9.8
- laravel/pint: v1.17.0
- nunomaduro/collision: v8.3.0
- orchestra/testbench: v9.1.2
- pestphp/pest: v2.34.9
- pestphp/pest-plugin-arch: v2.7.0
- pestphp/pest-plugin-laravel: v2.4.0
- phpstan/extension-installer: ^1.3.1
- phpstan/phpstan-deprecation-rules: ^1.2.0
- phpstan/phpstan-phpunit: ^1.4.0
This package is auto-updated.
Last update: 2024-10-31 16:16:09 UTC
README
Download Meteorological Data from OPEN-METEO API (https://open-meteo.com/en)
Open-Meteo collaborates with National Weather Services providing Open Data with 11 to 2 km resolution. Our high performance APIs select the best weather model for your location and provide data as a simple JSON API.
APIs are free without any API key for open-source developers and non-commercial use. You can embed them directly into your app.
Installation
You can install the package via composer:
composer require chimilevschi/laravel-weather
You can publish the config file with:
php artisan vendor:publish --tag="laravel-weather-config"
This is the contents of the published config file:
return [ 'temperature_unit' => 'celsius', 'wind_speed_unit' => 'kmh', 'precipitation_unit' => 'mm', 'time_format' => 'iso8601', 'timezone' => 'GMT', ];
Usage
$weather = \Clevada\Weather\Weather::location(30.0812558, 31.2511902) ->current() ->get();
Functions:
15-minutely Functions:
Hourly Functions:
Daily Functions:
WMO Weather interpretation codes (WW):
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.