Injam Server Side SDK for Laravel
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
src
tests
.coveralls.yml
.editorconfig
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml

README.md

Injam Laravel Package

Build Status styleci Scrutinizer Code Quality SensioLabsInsight Coverage Status

Packagist Packagist Packagist

"Injam" is a Next Generation Real-Time Machine that provides a set of Geolocation, Geospatial, Messaging and Streaming services in fast (almost-teleporting) and secure way. So this Package enables you to interact with them easily from server side.

Installation

Install via composer

composer require injamio/injam-laravel-package

Register Service Provider

Note: This and next steps are optional if you use Laravel >= 5.5 with package auto discovery feature.

Add service provider to config/app.php in providers section

Injamio\InjamLaravelPackage\ServiceProvider::class,

Register Facade

Register package facade in config/app.php in aliases section

'Injamio' => Injamio\InjamLaravelPackage\Facades\InjamLaravelPackage::class,

Publish Configuration File

php artisan vendor:publish --provider="Injamio\InjamLaravelPackage\ServiceProvider" --tag="config"

API Key

Add INJAM_API_KEY to your .env file:

INJAM_API_KEY=YOUR_INJAM_API_KEY

Here you can find you application api key.

Usage

Use package in your controller:

use Injamio\InjamLaravelPackage\InjamLaravelPackage;

Create instance of InjamLaravelPackage class:

$injam = new InjamLaravelPackage;

Add Tracker:

$tracker = $injam->addTracker(TRACKING_PHYSICAL_ID, TRACKER_MOBILE);

Example:

$tracker = $injam->addTracker('zxcvbn', '09123456789');

Add Geofence webhook:

$hook = $injam->addGeoFenceWebhook(OBJECT_TYPE, PHYSICAL_ID, TARGET_POINT, RADIUS_IN_METERS, ENDPOINT, DETECT_EVENTS);

Example:

$hook = $injam->addGeoFenceWebhook('bike', 'zxcvbn', '35.7384336,51.4026536', 60, 'https://api.example.com/v1/do/action', 'enter,exit');