"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.
Install via composer
composer require injamio/injam-laravel-packageNote: 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 package facade in config/app.php in aliases section
'Injamio' => Injamio\InjamLaravelPackage\Facades\InjamLaravelPackage::class,php artisan vendor:publish --provider="Injamio\InjamLaravelPackage\ServiceProvider" --tag="config"Add INJAM_API_KEY to your .env file:
INJAM_API_KEY=YOUR_INJAM_API_KEYHere you can find you application api key.
Use package in your controller:
use Injamio\InjamLaravelPackage\InjamLaravelPackage;Create instance of InjamLaravelPackage class:
$injam = new InjamLaravelPackage;$tracker = $injam->addTracker(TRACKING_PHYSICAL_ID, TRACKER_MOBILE);Example:
$tracker = $injam->addTracker('zxcvbn', '09123456789');$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');
