Download the PHP package vannut/statamic-weather-addon without Composer

On this page you can find all versions of the php package vannut/statamic-weather-addon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-weather-addon

Weather Forecast

Display the current weather or a 7-day forecast for any lat/lon on earth.

Attention: Find something broken or missing: please create an issue!

OpenWeatherMap

The weather data itself is coming from the OpenWeatherMap api. Especially the One-Call API which delivers all the relevant data in one call. And to make it even better: It's free for the first 1,000,000 calls/month (or 60 calls/minute)

Installation

  1. Install add on through composer: composer require vannut/statamic-weather-addon
  2. Create an account at OpenWeatherMap.
  3. After signing in go to API keys and generate a new one.
  4. Go to your Statamic Control Panel and look for the Weather entry. It should be in the sidebar.
  5. Fill out the settings-form with your api-key, latitude & longitude
  6. Go to the Current Data page and fetch your first weather forecast!
  7. Or Go to the Command line and perform the first initial fetch of your specific data: php artisan weather:fetchForecast

Renewing the forecast

Nothing is as changeable as the weather. Therefore this addon adds a hourly call to the scheduler of Statamic/Laravel. All you have to do is make sure the scheduler is run, by means of a cron-job. Take a look at Laravels documentation on this!

Usage

This addon does not provide any styling, it just caches the json response and passes the raw data through to the two tags.

You can find every field in the api-response on the api-docs of openweathermap.

Next to the data provided by the API, the addon adds a couple of nice additional fields:

You'll have two tags to your disposal: {{ forecast }} and {{ current_weather }}

Simple 7 day forecast

With the {{ forecast }} tag you will be able to display a card per day with the forecast. This data is located in the days array which you can traverse and add your styling magic.

This is a very simple example:

Current weather

Want to display the current weather of your location? Use the {{ current_weather }} tag. As this is a json-collection you can get its data as following:

Widget

You can add a basic Forecast widget to your CP dashboard, by adding it in your /config/statamic/cp.php:


Compatible with Statamic v3 Addon on Packagist


All versions of statamic-weather-addon with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vannut/statamic-weather-addon contains the following files

Loading the files please wait ....