Download the PHP package rawaby88/open-weather-laravel without Composer
On this page you can find all versions of the php package rawaby88/open-weather-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rawaby88/open-weather-laravel
More information about rawaby88/open-weather-laravel
Files in rawaby88/open-weather-laravel
Package open-weather-laravel
Short Description Laravel package to provide Open Weather Map API integration
License MIT
Informations about the package open-weather-laravel
Open Weather Map Laravel
🌡 Laravel package to provide Open Weather map API integration.
Star ⭐ repo to show suport 🍺
To use this package you'll need to register into Open Weather Map service and generate an API Key. For more information visit: https://home.openweathermap.org/api_keys
Installation
Require this package with composer:
Add Service Provider & Facade
For Laravel 5.5+
Once the package is added, the service provider and facade will be autodiscovered.
For Older versions of Laravel
Add the ServiceProvider to the providers array in config/app.php
:
Publish Config
Once done, publish the config to your config folder using:
Configuration
Once the config file is published, open config/open-weather.php
Global config
api_token
Your API key goes here. Or add it to your .env file WEATHER_API_TOKEN
api_icon_url
Url display the icons that sent from the API / or create your own icons
unit
Temperature is available in fahrenheit, celsius and kelvin units.
language
Weather description language.
Usage
Call current weather data for one location
By city name
You can call by city name or city name and country code or city name, country state code . Please note that searching by states available only for the USA locations.
By city id
You can make an API call by city ID. List of city ID 'city.list.json.gz' can be downloaded
By geographic coordinates
You can make an API call by zip code. Please note if country is not specified then the search works for USA as a default.
By ZIP code
You can call by latitude and longitude coordinates
Example for single result
Call current weather data for several cities
Cities within a rectangle zone
API returns the data from cities within the defined rectangle specified by the geographic coordinates.
Cities within a rectangle zone
API returns the data from cities within the defined rectangle specified by the geographic coordinates.
Example for several cities
Temperature Object
Contents Temperature information
Weather Object
Contents Weather information
Sun Object
Contents Sun information
Location Object
Contents Location information
Parameters unit & language
Weather parameters unit
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Mahmoud Osman
- All Contributors
License
MIT The MIT License (MIT). Please see License File for more information.