Download the PHP package sashalenz/dinstar-api without Composer
On this page you can find all versions of the php package sashalenz/dinstar-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sashalenz/dinstar-api
More information about sashalenz/dinstar-api
Files in sashalenz/dinstar-api
Package dinstar-api
Short Description Laravel client for the Dinstar GSM Gateway HTTP API
License MIT
Homepage https://github.com/sashalenz/dinstar-api
Informations about the package dinstar-api
Dinstar GSM Gateway API for Laravel
A Laravel client for the Dinstar GSM Gateway HTTP API (the "new API",
firmware ≥ 1102). Implements every endpoint described in the official
Dinstar GSM Gateway HTTP API document
(v202011): SMS, USSD, port management, CDR, STK, device status, and the
push-event payloads that the gateway can send back to your application.
Requirements
| Package | Version |
|---|---|
| PHP | ^8.3 \| ^8.4 \| ^8.5 |
| Laravel | ^11.0 \| ^12.0 \| ^13.0 |
Installation
Publish the configuration file:
Then add the gateway credentials to your .env:
Most Dinstar units ship with a self-signed certificate, so DINSTAR_API_VERIFY_SSL
defaults to false. Set it to true if you have installed a valid certificate.
Make sure the new-version API is enabled on the gateway: Mobile Configuration → Basic Configuration → API.
Usage
The service is registered as a singleton and is exposed through the
DinstarApi facade and the Sashalenz\DinstarApi\DinstarApi class.
Every method returns an Illuminate\Support\Collection containing the raw
JSON response from the gateway. Gateway-side errors raise
Sashalenz\DinstarApi\Exceptions\DinstarException.
Talking to multiple gateways
API reference
SMS
Other SMS endpoints:
USSD
Port / SIM management
Call forwarding
CDR
STK
Device status
Notification channel
The package ships a Laravel notification channel — DinstarSmsChannel —
so you can dispatch SMS through the gateway with the regular notification
pipeline (queues, events, on-demand notifications, all of it).
Add the channel to your notification's via() and implement
toDinstarSms():
toDinstarSms() may also return a plain string for the simplest case:
Tell Laravel where to route the SMS by adding routeNotificationForDinstarSms
to the notifiable model — return either a string or an array of phone
numbers:
On-demand notifications work the same:
Push events
The gateway can be configured to push events (incoming SMS, sending results,
delivery receipts, USSD replies, register status, CDR, device events,
exceptions) to your application. Use PushEvent to parse them in a single
controller:
Error handling
The package recognises the documented error codes (200, 202, 400,
404, 413, 500, 550) and includes a human-readable description in
the exception message.
Testing
The test suite uses Pest and Laravel's
Http::fake() to stub gateway responses, so it runs without any network
access.
Code style
Changelog
See CHANGELOG.
Credits
License
The MIT License (MIT). See LICENSE.
All versions of dinstar-api with dependencies
ext-json Version *
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.16