Download the PHP package coderjp/forecast without Composer
On this page you can find all versions of the php package coderjp/forecast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coderjp/forecast
More information about coderjp/forecast
Files in coderjp/forecast
Package forecast
Short Description A Laravel package that generates a 5 day forecast for the given IP address
License
Homepage https://github.com/coderjp/forecast
Informations about the package forecast
Forecast
Forecast allows you to fetch the Weather Forecast for the next 5 days based on an IP address.
Installation
Require this package with composer using the following command:
Publish the various resources needed
Run the migrations - this library stores all location and forecast data in the database.
Configuration
All configuration is stored in config/forecast.php
. By default there are a handful of drivers used for geolocation and forecasting already enabled.
Some drivers require API keys in order to use them - these can be specified in the config file.
Should a driver fail to get a response (server down, invalid/missing api key etc.), the next driver in the list will be used, and so on.
Usage
By default, the library publishes a simple route to /forecast
. This allows you to enter an IP address and lookup the five day forecast in the browser.
Models
All data is cached in the database. Two models are available for querying this data:
Coderjp\Forecast\Models\Forecast
- Holds the location dataCoderjp\Forecast\Models\Day
- Holds each day's forecast
CLI
A command line tool is available for looking up the forecast for an IP: