Download the PHP package grigorygerasimov/laravel-weather without Composer

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

Laravel-Weather Package

Laravel package for weather and geo info based on WeatherAPI (JSON RestAPI only)

Installation

The package can be installed via Composer:

composer require grigorygerasimov/laravel-weather

You don't need to register the package Service Provider - this will be done automatically once you install the package.

For publishing the package config please run the following command. There are also some example views and the package docs under the same tag.

php artisan vendor:publish --tag=laravel-weather

Start

Once the package is installed and the config is published, you are free to use the package in your Laravel projects.

All you need to do is to use the Weather facade (GrigoryGerasimov\Weather\Facades\Weather) and build custom fluent interfaces, e.g.:

Weather::api('forecast')->city('Prague')->forecastDays(3)->requireAQI(true)->requireAlerts(true)->requireTides(true)->lang('cs')->get();

The api() method is mandatory, as it configures the relevant api method and api key.

By default the WeatherAPI Free plan key is used, however you can always adjust it in the laravel-weather config, if you have your own WeatherAPI key.

As for the api methods, the following ones are available.

By default, the current method is used. Please note that the default WeatherAPI Free plan key is limited for the history method.

The available Weather facade methods are:

The facade method get() will provide you with the result of your request, however you can also access the request uri directly via the uri() method.

For demonstration purpose, the package also includes a number of components and views to the basic Weather api methods. These views are some very simple data lists without any particular styling, they serve merely for the visual representation of the weather and geo info retrieved with the help of this package. You can check them out under the following web-routes

For further details, you can also check the weather controller and components

Screenshot 2023-06-18 at 11 25 36 Screenshot 2023-06-18 at 11 26 11 Screenshot 2023-06-18 at 11 26 43 Screenshot 2023-06-18 at 11 27 33

Documentation

For the detailed infos on the package structure and api, please refer to the Laravel-Weather documentation which is published into your public folder. While running the php artisan serve command, you can access the docs as follows:

http://localhost:8000/vendor/laravel-weather/docs/index.html

Please don't forget to refer to the official WeatherAPI documentation to get a better glimpse of the weather and geo data via a JSON RestAPI.

License

The package is under MIT license, thus you are free to use it in your projects.

Feedback

As I've never had any previous experience in creating packages, I would appreciate some feedback: whether the Laravel-Weather package is easy/hard to use, what can be improved etc.

Feel free to get in touch with me under [email protected]


All versions of laravel-weather with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-curl Version *
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 grigorygerasimov/laravel-weather contains the following files

Loading the files please wait ....