Download the PHP package mysteryinfosolutions/yourbulksms without Composer
On this page you can find all versions of the php package mysteryinfosolutions/yourbulksms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mysteryinfosolutions/yourbulksms
More information about mysteryinfosolutions/yourbulksms
Files in mysteryinfosolutions/yourbulksms
Package yourbulksms
Short Description A framework-agnostic PHP SDK for YourBulkSMS gateway with optional Laravel support.
License MIT
Informations about the package yourbulksms
YourBulkSMS PHP SDK (mysteryinfosolutions/yourbulksms)
A framework-agnostic PHP package for integrating with the YourBulkSMS HTTP API gateway. It provides a clean, SDK-like API, robust data normalization, custom exception handling, defensive webhook parsing, and optional Laravel integration.
Table of Contents
- Features
- Installation
- Client Initialization
- Public Methods & Feature Showcase
- Send Standard SMS
- Send Unicode SMS
- Send Scheduled SMS
- Send Scheduled Unicode SMS
- Send International SMS
- Check Route Balance
- Fetch Delivery Report
- Overriding Configuration Per-Request
- Route Constants (Enums)
- Webhook & DLR Parsing
- Variant A: Query String Style
- Variant B: JSON POST data Payload
- Response DTO Structures
- Laravel Integration
- CodeIgniter 4 Integration
- Testing
Features
- Framework Agnostic: Works out of the box in plain PHP, CodeIgniter 4, Laravel, or any PSR-4 compliant application.
- Guzzle Client Wrapper: Decoupled, clean HTTP request execution.
- Normalized Response DTOs: Consistent response shapes across all endpoints.
- Route Constants: Clear mapping of gateway route IDs.
- Robust Webhook Support: Automatically parses multiple DLR push payload formats.
- Defensive Error Handling: Explicit custom exceptions for validation, HTTP, authentication, and webhook errors.
Installation
Install the package via Composer:
Client Initialization
To instantiate the client manually in plain PHP, pass an array configuration:
Public Methods & Feature Showcase
Send Standard SMS
Accepts a single mobile number (string) or an array of numbers. Arrays are normalized to a comma-separated format automatically.
Send Unicode SMS
Appends unicode=1 and sends the message payload as UTF-8 encoded text.
Send Scheduled SMS
Accepts a DateTimeInterface instance or a string format. Automatically normalizes it to the gateway-required Y-m-d H:i:s format.
Send Scheduled Unicode SMS
Combines Unicode payload and scheduling logic.
Send International SMS
Uses the gateway global SMS endpoint (/global-smsapi.php).
Check Route Balance
Checks remaining SMS balance on a specific route.
Fetch Delivery Report
Retrieves the real-time status of an SMS by its message ID.
Overriding Configuration Per-Request
You can override defaults (like sender, route, or dlt_te_id) on a per-request basis by passing them in the $options array:
Route Constants (Enums)
Use MysteryInfo\YourBulkSms\Support\Route to keep code clean and self-documenting:
Webhook & DLR Parsing
The SDK automatically detects the incoming webhook format and returns a normalized WebhookReportCollection containing WebhookReportItem objects.
Variant A: Query String Style
Webhook request format: GET /webhook.php?requestId=12345&userId=67890&status=000&date=1680766504000&senderId=TXTSMS&number=919999999999&desc=Delivered
Variant B: JSON POST data Payload
Webhook request format: POST /webhook.php with a data parameter containing a raw JSON array string.
Parsing implementation:
Response DTO Structures
All requests return structured DTOs containing the following public fields:
SendSmsResponse & DeliveryReportResponse
bool $success:trueif the gateway returns a success status.?string $code: The raw status code from the gateway (e.g.001,002).?string $message: Mapped human-readable message fromResponseCodemapper.mixed $data: Mapped response parameters (from JSON).string|array|null $raw: The exact HTTP response body from the gateway.
BalanceResponse
bool $success: Request outcome.?string $code: Gateway code.?string $message: Human-readable status.mixed $balance: Extracted balance value.mixed $data: Decoded payload structure.string|array|null $raw: Raw response body.
Laravel Integration
-
Publish the configuration file:
-
Add environment variables in
.env: - Call the API using the Facade:
CodeIgniter 4 Integration
Instantiate the client directly within your controllers:
Testing
Run tests locally using PHPUnit: