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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dinstar-api

Dinstar GSM Gateway API for Laravel

Latest Version on Packagist Total Downloads

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

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4|^8.5
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sashalenz/dinstar-api contains the following files

Loading the files please wait ...