sejurplacut / openweather
Openweather API integration
Installs: 51
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/sejurplacut/openweather
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~5.0
- illuminate/support: 4.2.*
This package is not auto-updated.
Last update: 2025-12-06 22:59:19 UTC
README
Openweather API integration for Laravel framework. Get current weather or daily forecast using multiple parameters.
Installation
Using composer:
"require": {
"sejurplacut/openweather": "dev-master"
}
Setup
-
Add the following to your config/app.php file in the service providers array
'Sejurplacut\Openweather\Provider\OpenweatherServiceProvider' -
Add the following to your config/app.php file in the aliases array
'OpenWeather' => 'Sejurplacut\OpenWeather\Facades\Openweather' -
Publish configuration file:
php artisan config:publish sejurplacut/openweather
Note: Change the endpoint option with caution.
Usage
Get the daily forecast.
$data = Openweather::getInstance()->getDailyForecast(array(
'cityName' => 'Paris',
'latitude' => '',
'longitude' => '',
'days' => ''
'units' => 'metric',
'languageCode' => 'en',
));
Get the current weather conditions
$data = Openweather::getInstance()->getCurrentWeather(array(
'cityName' => 'Paris',
'latitude' => '',
'longitude' => '',
'radius' => '',
'units' => 'metric',
'languageCode' => 'en',
));