injamio / injam-laravel-package
Injam.io Laravel Package
Requires
- php: >=7.0
- guzzlehttp/guzzle: ~6.0
- illuminate/support: ~5.5.0
Requires (Dev)
- orchestra/testbench: ~3.5.0
- phpunit/phpunit: ~6.0
This package is not auto-updated.
Last update: 2025-05-11 08:08:34 UTC
README
"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');