Download the PHP package rjvandoesburg/laravel-apixu-client without Composer
On this page you can find all versions of the php package rjvandoesburg/laravel-apixu-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rjvandoesburg/laravel-apixu-client
More information about rjvandoesburg/laravel-apixu-client
Files in rjvandoesburg/laravel-apixu-client
Package laravel-apixu-client
Short Description A laravel package to interface with the Apixu API
License MIT
Informations about the package laravel-apixu-client
A laravel package to interface with the Apixu API
This package adds a facade and a dependency injectable class you can use to make easy calls to the api
Install
You can install the package via composer:
You must install the following service provider:
This package requires an API key that can be stored in the .env
file. You can get your key here: https://www.apixu.com/
The following settings are available for your .env
file:
The cache length is how long before new data is fetched from the server, this because you might want to limit the API calls
These settings are set in a config file that you can edit yourself, should you desire to do so. Execute the following command to get the config file
A file named apixu.php
will be created in the config directory.
Usage
The API has 4 endpoint
Each request needs certain parameters, read more about those here
To build op the filters you need to use a FiltersClass and all parameters you can set for the API are defined as properties. To use the facade to get the current weather, use the following:
This will return a CurrentResponse
which contains all properties returned.
You can use this response to easily output the response.
The available methods are:
or use the dependency injection method
Credits
License
The MIT License (MIT). Please see License File for more information.