Download the PHP package ekstremedia/laravel-yr without Composer

On this page you can find all versions of the php package ekstremedia/laravel-yr. 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 laravel-yr

Laravel Yr Weather

Get weather data from Yr (MET Norway) in your Laravel apps. Simple, cached, and ready to use.

Installation

Publish the config:

Add your details to .env:

Note: MET Norway requires you to identify your app with contact info.

Quick Start

See it in action

Visit the interactive demo page:

The demo page features:

Search by location:

Use specific coordinates:

To disable the demo route, add to your .env:

Get weather by coordinates

Get weather by address

Get forecast

Get sunrise/sunset data

Get moon phase data

Response Example

Usage

Using the Weather Helper (Recommended)

The easiest way to use this package is through the WeatherHelper service:

Using API Routes

The package automatically registers API routes (fully configurable):

Customize API routes in your .env:

With the above config, routes become:

Using Services Directly

In Blade templates

Current weather:

5-Day Forecast:

Sunrise/Sunset:

Moon Phase:

In JavaScript

Available Data

Weather Data

Each weather response includes:

Sun Data

Sunrise/sunset responses include:

Moon Data

Moon phase responses include:

Configuration

The config file (config/yr.php) has these settings:

Weather data is automatically cached to avoid hitting the API too often.

How caching works

The package intelligently caches all API requests:

All GET endpoints (/api/weather/current and /api/weather/forecast) benefit from this caching layer, ensuring fast responses while respecting API rate limits.

Customization

Want to change how the weather cards look? Publish the views:

Then edit resources/views/vendor/laravel-yr/components/weather-card.blade.php.

Want to use local weather icons? Publish the symbols:

This copies 83 weather symbol SVGs to public/vendor/laravel-yr/symbols.

Licensing and Attribution

Weather Data

All weather data is provided by The Norwegian Meteorological Institute (MET Norway) and is licensed under:

When using this package, you must provide appropriate credit to MET Norway as the source of the weather data. The package components automatically include the required attribution.

Required Attribution: "Weather data from The Norwegian Meteorological Institute (MET Norway)"

For more details, see MET Norway's Licensing and Crediting Policy.

Weather Icons

The weather symbol SVG files are licensed under the MIT License. Copyright (c) 2015-2017 Yr.no.

Package Code

This Laravel package code is licensed under the MIT License.

Credits

License

MIT License - See LICENSE file for details

Note: This package's MIT license applies only to the package code itself. Weather data and icons have their own licenses as stated above.


All versions of laravel-yr with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
guzzlehttp/guzzle Version ^7.0
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 ekstremedia/laravel-yr contains the following files

Loading the files please wait ...