Download the PHP package basduchambre/juniper-mist-laravel without Composer
On this page you can find all versions of the php package basduchambre/juniper-mist-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download basduchambre/juniper-mist-laravel
More information about basduchambre/juniper-mist-laravel
Files in basduchambre/juniper-mist-laravel
Package juniper-mist-laravel
Short Description Juniper Mist API wrapper for Laravel
License MIT
Informations about the package juniper-mist-laravel
Juniper Mist API wrapper for Laravel
This is a wrapper to easily make API calls to Juniper Mist. Still basic and only some metrics for now, but big plans to expand this package in the future.
Prerequisites
- Juniper Mist API key
- Juniper Mist Site ID
- Juniper Mist Map ID
Installation
Install the package through composer
To publish the junipermist.php
config file, run the following command. Publishing will also make an Alias JuniperMist
, so you don't have to import.
The Mist data tables will be created upon running the migration command:
This will create two tables: mist_data to store the general metrics and mist_fetch_data to store temporary client data.
Make sure your .env
has the following values filled
Additionally you can set the JUNIPER_MIST_BASE_URL
. For now it is set to the default Juniper Mist api base url. If it changes in the future, you can easily set it in your .env
.
Usage
To retreive data, create a custom route
and Controller
. An example is given below.
Chaining methods
It is possible to chain different methods to alter the output like below:
Live clients
The JuniperMist class retrieves the live client data for connected and unconnected clients. The possible methods to alter the output for this class are the following:
- type - the type of live client you want to retrieve (clients/unconnected_clients). Default is clients.
- ssid - a specific ssid name to filter the output by
- siteId - the site ID of the location you want to retrieve data from.
- mapId - the map ID of the location you want to retrieve data from.
Client insight metrics
The JuniperMistMetrics class retrieves the client insight metrics. The possible methods to alter the output for this class are the following:
- metric - the type of metric you want to retrieve (loyalty/dwell/visit/zones). Default is loyalty.
- start - The start time for the data you want to retrieve in a Unix timestamp.
- end - The end time for the data you want to retrieve in a Unix timestamp.
- interval - The intervals in which the data will be returned in seconds (86400/3600). Default is 86400.
- siteId - the site ID of the location you want to retrieve data from.