Download the PHP package beziworld/laravel-serwersms without Composer
On this page you can find all versions of the php package beziworld/laravel-serwersms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beziworld/laravel-serwersms
More information about beziworld/laravel-serwersms
Files in beziworld/laravel-serwersms
Package laravel-serwersms
Short Description Laravel integration for SerwerSMS.pl: SMS, MMS and voice sending, notification channel, delivery reports, HLR and multiple accounts.
License MIT
Homepage https://github.com/beziworld/laravel-serwersms
Informations about the package laravel-serwersms
Laravel SerwerSMS
Laravel integration for SerwerSMS.pl (HTTPS API v2): SMS ECO and FULL, personalised, voice and MMS messages, a notification channel, delivery report and incoming message webhooks, HLR checks and multiple accounts.
Polska wersja dokumentacji
Features
- Fluent builders:
SmsMessage,PersonalizedMessage,VoiceMessage,MmsMessage - Scheduling, sender names (SMS FULL) or SMS ECO,
unique_idtracking, flash, priority channel, validity, test mode - Automatic Unicode (
utf) for texts with Polish characters,SmsCounterhelper for GSM-7 / UCS-2 parts - Polish numbers normalised to
+48...(500 600 700,48500600700,0048...) serwersmsnotification channel, including on-demand notifications and per-message account selection- Delivery report and incoming message endpoints dispatching Laravel events
- Reports, incoming messages, HLR check and network lookup, account limits, sender names, blacklist, groups, contacts and templates
- Multiple accounts:
SerwerSms::connection('name')andSerwerSms::using([...])for tenant credentials - Typed responses and one exception hierarchy exposing the SerwerSMS.pl error code
- PHP 8.3+, Laravel 12 and 13, PHPStan level 8
Installation
Sending messages
Other options: toGroup(), toContact(), utf(), flash(), speed(), validity($minutes), dlrUrl(), test().
When the message has a sender and the text contains characters outside the GSM alphabet, utf is enabled
automatically (set SERWERSMS_UTF=false to disable it).
Segment estimate before sending: SmsCounter::parts($text) and SmsCounter::encoding($text)
(Beziworld\SerwerSms\Support\SmsCounter).
Account and data
Notification channel
The recipient is taken from the notifiable:
On-demand: Notification::route('serwersms', '500600700')->notify(new OrderShipped($order));
A message may define its own recipients with ->to() and its account with ->connection('shop'). A notifiable
without a phone number is skipped silently.
Delivery reports and incoming messages
-
Enable the endpoints and choose a secret token:
-
In the SerwerSMS.pl panel (Ustawienia interfejsów > HTTPS XML API > Raporty doręczeń) set the delivery report URL template (or send it with every message through
SERWERSMS_DLR_URL/dlrUrl()):Forward incoming messages (SMS ECO replies, ND/NDI) to
https://your-app.com/serwersms/incoming?token=long-random-string&phone=...&text=...using the placeholders offered by the panel for the sender number, text and date. MMS posted in theitemsformat of the API are supported too. - Listen to the events:
Both endpoints answer OK, which stops the retries of SerwerSMS.pl (5, 15, 60 minutes and 24 hours). SerwerSMS.pl
does not sign callbacks, hence the token: without a configured token every request is rejected. The token travels
in the query string and appears in access logs, so use a long random value and the IP allow-list. Add
&connection=shop to the URL in multi-account setups; it is exposed as $event->report->connection. Keep listeners
idempotent.
Multiple accounts
Options outside connections (test_mode, utf, dlr_url, http, ...) are shared and may be overridden per
connection.
Error handling
All exceptions extend Beziworld\SerwerSms\Exceptions\SerwerSmsException:
| Exception | When |
|---|---|
ApiException |
SerwerSMS.pl returned an error (errorCode(), errorType(), httpStatus(), payload()) or could not be reached |
InvalidMessage |
Message without recipients or content, invalid unique_id |
InvalidConfiguration |
Missing credentials or unknown connection |
CouldNotSendNotification |
Notification without a valid toSerwerSms() |
SerwerSMS.pl reports errors with HTTP 200 and an error object, for example 1001 InvalidUser, 1012 InvalidToken,
3002 (SMS FULL limit exhausted) or 3106 (sender name not allowed). isAuthenticationError() covers the
credential errors.
Retries
Retries are disabled by default (SERWERSMS_RETRIES=0): a request that timed out may still have been accepted, and
repeating it would send the SMS twice. When enabling retries, give every message a uniqueId() and enable duplicate
control of unique_id in the panel.
Testing your application
Development
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: [email protected]
- Issues and feature requests: GitHub issues
- Security vulnerabilities: see SECURITY.md
Need a custom integration, an SMS gateway setup or a Laravel project? Get in touch through beziworld.eu.
License
MIT. See LICENSE.md. This package is not affiliated with SerwerSMS.pl.
All versions of laravel-serwersms with dependencies
ext-json Version *
illuminate/notifications Version ^12.0|^13.0
guzzlehttp/guzzle Version ^7.8
illuminate/contracts Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0