sejurplacut / openweather
Openweather API integration
dev-master
2015-02-08 09:24 UTC
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~5.0
- illuminate/support: 4.2.*
This package is not auto-updated.
Last update: 2025-06-07 20:22:04 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',
));