Download the PHP package exposuresoftware/laravel-zway without Composer
On this page you can find all versions of the php package exposuresoftware/laravel-zway. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download exposuresoftware/laravel-zway
More information about exposuresoftware/laravel-zway
Files in exposuresoftware/laravel-zway
Package laravel-zway
Short Description Z-Way Server SDK for Laravel
License MIT
Homepage https://github.com/ExposureSoftware/LaravelWave
Informations about the package laravel-zway
LaravelWave
Provides a Laravel package to integrate with an existing Z-Way server.
Installation
Installation is performed via Composer.
Install Composer
See the Composer Getting Started documentation for how to install Composer on your platform.
Require LaravelWave in your project
The simplest way to do this is by running this command:
composer require exposuresoftware/laravel-zway
Alternatively, you may add the requirement directly by adding
"exposuresoftware/laravel-zway": "^0.0.1"
to your require
section of composer.json
.
Publish the package to your project
Run php artisan vendor:publish
.
This will add laravelwave.php
to your config directory.
Configure the package
The package is configurable via environment variables. To configure in this way add the following
lines to your .env
, changing the values to match your configuration:
You may also edit the laravelwave.php
file in your config directory.
Note: It is not recommended to store your credentials in the configuration file if committed to a publicly accessible repository (like Github).
Usage
There are a number of methods of employing the SDK in your project. Each provides access to all the methods made accessible, a full list of which is available in this document.
All communication with the Z-Way server, except logging in, require authentication when accessed via this SDK at this time. Once you have successfully logged into the server once a token will be optionally stored for you. If you choose not to store the token it will only be available for the life of the current SDK instance.
Via provided Facade
Via Laravel container
Note that the SDK can be injected as a dependcy.
Via instantiation directly
Commands
Commands are provided to interact with the Z-Way API. These can also be scheduled via the Laravel task scheduling.
For full details of each command please see the help
command of Artisan.
Signature | Description |
---|---|
zway:fetch-devices | Retrieve devices via the API. |
Available Methods
Parameters listed are examples and those in italics are optional.
Method | Returns | Description |
---|---|---|
hasToken() | bool |
Returns true or false depending on if the current instance has a token. |
login('admin', 'secret', true) | bool |
Logs in with the given credentials. If none are provided the credentials from package configuration are used. The last parameter represents whether or not to store the token. |
listDevices(true) | Illuminate\Support\Collection |
Returns a collection of all the devices known to the server. If passed false these will not be stored in the database. |
update(device) | ExposureSoftware\LaravelWave\Device |
Returns the Device with updated attributes to reflect current state. |
command(device, command, parameters) | bool |
Runs a command on the given device with the provided parameters. See the "Virtual Device Types" section of the documentation for commands supported per device*. |
* Only switchBinary
is supported in this version.
Events
Events are dispatched during different operations so that actions may be taken in response.
All events are in the ExposureSoftware\LaravelWave\Events
namespace.
Event | Cause | Available Properties |
---|---|---|
CommandSent |
Set after a command has been sent to the Z-Way Server. | string command,ExposureSoftware\LaravelWave\Models\Device device,bool successful,array parameters |
Sponsorship
If you would like to provide funding for this project please use any of the methods listed below.
Tidelift
Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.
Security Vulnerabilities
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
All versions of laravel-zway with dependencies
guzzlehttp/guzzle Version ^6.3
doctrine/dbal Version ^2.9
ext-json Version *