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

dev-master 2015-02-08 09:24 UTC

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

  1. Add the following to your config/app.php file in the service providers array

     'Sejurplacut\Openweather\Provider\OpenweatherServiceProvider'
    
  2. Add the following to your config/app.php file in the aliases array

     'OpenWeather' => 'Sejurplacut\OpenWeather\Facades\Openweather'
    
  3. 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',
));