PHPackages                             dreamsms/laravel-dreamsms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. dreamsms/laravel-dreamsms

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

dreamsms/laravel-dreamsms
=========================

A Laravel package providing a fluent, easy-to-use wrapper around the DreamSMS API for user registration, token management, sender configuration, balance inquiry and sending single or multi-recipient SMS messages. Developed by هوية الأحلام لتقنية المعلومات (Dreams), Saudi Arabia’s leading creative &amp; tech service provider since 2006.

v1.1.1(2mo ago)4291MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3|^8.4

Since Jun 24Pushed 2mo agoCompare

[ Source](https://github.com/YacoubAl-hardari/laravel-dreamsms)[ Packagist](https://packagist.org/packages/dreamsms/laravel-dreamsms)[ Docs](https://github.com/YacoubAl-hardari/laravel-dreamsms)[ RSS](/packages/dreamsms-laravel-dreamsms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (12)Used By (0)

[![logo](https://private-user-images.githubusercontent.com/94101869/458416586-20d605e0-07d5-4e93-9ba0-634f7d02ae98.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxMzk5MTQsIm5iZiI6MTc3NDEzOTYxNCwicGF0aCI6Ii85NDEwMTg2OS80NTg0MTY1ODYtMjBkNjA1ZTAtMDdkNS00ZTkzLTliYTAtNjM0ZjdkMDJhZTk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzIyVDAwMzMzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNlOGVkMGJjYTg5OGI4MjZkMDY3ZTg3MjlkOWI5NzljYTY2NWM2Y2ZjMGZlODI1MzhmODg5MzM0ZDM2YjIwMGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BdOgiI1Y923amh52YIrVHdGV-PMF0CVIxPptrO7PYEQ)](https://private-user-images.githubusercontent.com/94101869/458416586-20d605e0-07d5-4e93-9ba0-634f7d02ae98.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxMzk5MTQsIm5iZiI6MTc3NDEzOTYxNCwicGF0aCI6Ii85NDEwMTg2OS80NTg0MTY1ODYtMjBkNjA1ZTAtMDdkNS00ZTkzLTliYTAtNjM0ZjdkMDJhZTk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzIyVDAwMzMzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNlOGVkMGJjYTg5OGI4MjZkMDY3ZTg3MjlkOWI5NzljYTY2NWM2Y2ZjMGZlODI1MzhmODg5MzM0ZDM2YjIwMGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BdOgiI1Y923amh52YIrVHdGV-PMF0CVIxPptrO7PYEQ)[![Screenshot 2025-06-24 165013](https://private-user-images.githubusercontent.com/94101869/458417831-b6f99206-6f37-4ad9-8ab1-8423680ed7c5.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxMzk5MTQsIm5iZiI6MTc3NDEzOTYxNCwicGF0aCI6Ii85NDEwMTg2OS80NTg0MTc4MzEtYjZmOTkyMDYtNmYzNy00YWQ5LThhYjEtODQyMzY4MGVkN2M1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzIyVDAwMzMzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTczNzg0NmEwZThhODk4ZmMxNDQxZWJmZmE0NjBlNDUxYzkzMWVhM2Q0OWUzMjgxYTUzYzMzNzVmMzdiZTQ4ZjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.AojyNM0kwYYTUieKGhgwSh46f16gPuqo_VK_xcjpTwg)](https://private-user-images.githubusercontent.com/94101869/458417831-b6f99206-6f37-4ad9-8ab1-8423680ed7c5.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQxMzk5MTQsIm5iZiI6MTc3NDEzOTYxNCwicGF0aCI6Ii85NDEwMTg2OS80NTg0MTc4MzEtYjZmOTkyMDYtNmYzNy00YWQ5LThhYjEtODQyMzY4MGVkN2M1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzIyVDAwMzMzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTczNzg0NmEwZThhODk4ZmMxNDQxZWJmZmE0NjBlNDUxYzkzMWVhM2Q0OWUzMjgxYTUzYzMzNzVmMzdiZTQ4ZjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.AojyNM0kwYYTUieKGhgwSh46f16gPuqo_VK_xcjpTwg)

Laravel DreamSMS Package Documentation
======================================

[](#laravel-dreamsms-package-documentation)

Comprehensive reference for every method provided by the `dreamsms/laravel-dreamsms` package.

---

1. Installation &amp; Configuration
-----------------------------------

[](#1-installation--configuration)

### 1.1 Install via Composer

[](#11-install-via-composer)

```
composer require dreamsms/laravel-dreamsms
```

### 1.2 Publish Configuration

[](#12-publish-configuration)

```
php artisan vendor:publish --provider="DreamSms\LaravelDreamSms\DreamSmsServiceProvider" --tag=config
```

### 1.3 Environment Variables

[](#13-environment-variables)

Add these to your `.env`:

```
DREAMSMS_BASE_URL=https://www.dreams.sa/index.php/api
DREAMSMS_USER=your_username
DREAMSMS_SECRET_KEY=your_api_secret_key
DREAMSMS_CLIENT_ID=your_oauth_client_id
DREAMSMS_CLIENT_SECRET=your_api_secret_key # as DREAMSMS_SECRET_KEY
DREAMSMS_SENDER_NAME=your_sender_name
```

### 1.4 Config File (`config/dreamsms.php`)

[](#14-config-file-configdreamsmsphp)

```
return [
    'base_url'      => env('DREAMSMS_BASE_URL'),
    'account_username'          => env('DREAMSMS_USER'),
    'secret_key'    => env('DREAMSMS_SECRET_KEY'),
    'client_id'     => env('DREAMSMS_CLIENT_ID'),
    'client_secret' => env('DREAMSMS_CLIENT_SECRET'),
    'sender_name'  => env('DREAMSMS_SENDER_NAME'),
];
```

How To Get Sender Name, Account Username, client\_secret, and client\_id
========================================================================

[](#how-to-get-sender-name-account-username-client_secret-and-client_id)

1. Account Username
-------------------

[](#1-account-username)

Your **Account Username** is the username you use to log in to your Dreams account.

2. client\_id
-------------

[](#2-client_id)

To obtain your **client\_id**:

- Visit the following URL:

    -
- Copy the displayed **client\_id**.

3. client\_secret
-----------------

[](#3-client_secret)

To retrieve your **client\_secret**:

- Go to your profile page:

    -
- Copy your **client\_secret** from the information displayed there.

4. Sender Name
--------------

[](#4-sender-name)

To get your default **Sender Name**:

- Navigate to:

    -
- Identify and copy the default Sender Name from your listed sender names.

---

2. Service Usage
================

[](#2-service-usage)

Use the Facade or inject the `DreamSms` service.

```
use DreamSms; // Facade

// OR via DI
public function __construct(DreamSms\LaravelDreamSms\DreamSms $sms)
{
    $this->sms = $sms;
}
```

---

3. API Methods Reference
========================

[](#3-api-methods-reference)

Each section details endpoint, parameters, expected response, and Laravel usage.

---

3.1 `register(array $user): array`
----------------------------------

[](#31-registerarray-user-array)

**Description:** Register a new DreamSMS user account.

HTTP MethodEndpointPOST`/Register`### Parameters

[](#parameters)

NameTypeRequiredDescriptionuserstringyesDesired usernamepasswordstringyesPassword (min 6 chars)namestringyesFull namemobilestringyesMobile number (e.g. 9665...)emailstringyesValid e‑mail address### Example Request

[](#example-request)

```
$response = DreamSms::register([
    'user'     => 'newuser',
    'password' => 'pass1234',
    'name'     => 'John Doe',
    'mobile'   => '966512345678',
    'email'    => 'john@example.com',
]);
```

### Success Response

[](#success-response)

```
{
  "code": 999,
  "message": "Success register user",
  "data": { /* user details */ }
}
```

### Error Codes

[](#error-codes)

- `100`: Missing parameters
- `110`: Username already used
- `111`: Mobile already used
- `112`: Email already used
- `120`: Username contains invalid characters
- `121`: Password too short (&lt;6)
- `122`: Invalid username
- `123`: Invalid password

---

3.2 `generateToken(): array`
----------------------------

[](#32-generatetoken-array)

**Description:** Obtain OAuth2 Bearer token.

HTTP MethodEndpointPOST`/token/generate`### Parameters

[](#parameters-1)

NameTypeRequiredDescriptiongrant\_typestringyesMust be `client_credentials`client\_idstringyesOAuth client IDclient\_secretstringyesOAuth client secret### Example Request

[](#example-request-1)

```
$tokenData = DreamSms::generateToken();
```

### Success Response

[](#success-response-1)

```
{
  "token_type": "Bearer",
  "expires_in": 3600,
  "access_token": "eyJ0e..."
}
```

### Error Responses

[](#error-responses)

- `401 invalid_client`: Authentication failed
- `400 unsupported_grant_type`: Wrong grant type

---

3.3 `activate(string $user, string $code): array`
-------------------------------------------------

[](#33-activatestring-user-string-code-array)

**Description:** Activate a newly registered account.

HTTP MethodEndpointPOST`/activate`### Parameters

[](#parameters-2)

NameTypeRequiredDescriptionuserstringyesUsernamesecret\_keystringyesAPI secret keycodestringyesActivation code### Example Request

[](#example-request-2)

```
DreamSms::activate('newuser', '123456');
```

### Response Codes

[](#response-codes)

- `999`: Success
- `100`: Missing parameters
- `110`: Invalid username or secret\_key
- `111`: Wrong activation code

---

3.4 `checkUser(): array`
------------------------

[](#34-checkuser-array)

**Description:** Verify account credentials and activation status.

HTTP MethodEndpointPOST`/chk_user`### Parameters

[](#parameters-3)

NameTypeRequiredDescriptionuserstringyesUsernamesecret\_keystringyesAPI key### Success Response

[](#success-response-2)

```
{ "code": 999, "message": "Valid account" }
```

### Error Codes

[](#error-codes-1)

- `-100`: Missing parameters
- `-110`: Account not exist or wrong credentials
- `-111`: Account not activated
- `-112`: Blocked account

---

3.5 `balance(): array`
----------------------

[](#35-balance-array)

**Description:** Retrieve SMS credit balance.

HTTP MethodEndpointPOST`/chk_balance`### Parameters

[](#parameters-4)

NameTypeRequiredDescriptionuserstringyesUsernamesecret\_keystringyesAPI key### Success Response

[](#success-response-3)

```
{ "balance": 123.45 }
```

### Error Codes

[](#error-codes-2)

- `-100`: Missing parameters
- `-110`: Invalid credentials

---

3.6 `addSender(string $sender): array`
--------------------------------------

[](#36-addsenderstring-sender-array)

**Description:** Create a new sender name.

HTTP MethodEndpointPOST`/newsender`### Parameters

[](#parameters-5)

NameTypeRequiredDescriptionuserstringyesUsernamesecret\_keystringyesAPI key### Error Codes

[](#error-codes-3)

- `-113`: Duplicate sender
- `-114`: Invalid sender name (chars or length)

---

3.7 `senderStatus(string $sender): array`
-----------------------------------------

[](#37-senderstatusstring-sender-array)

**Description:** Check activation status of a sender.

HTTP MethodEndpointPOST`/senderstatus`### Parameters

[](#parameters-6)

NameTypeRequiredDescriptionuserstringyesUsernamesecret\_keystringyesAPI key### Status Values

[](#status-values)

- `Active`, `UnActive`, `Rejected`

---

3.8 `userSenders(): array`
--------------------------

[](#38-usersenders-array)

**Description:** List all senders for your account.

HTTP MethodEndpointPOST`/usersender`### Success Response (XML)

[](#success-response-xml)

```

    52
    MySender
    Active
    false
    2025-06-01
    ...

```

---

3.9 `sendSms(string $to, string $message, string $sender, array $options = []): array`
--------------------------------------------------------------------------------------

[](#39-sendsmsstring-to-string-message-string-sender-array-options---array)

**Description:** Send a single SMS, optionally with calendar reminder.

HTTP MethodEndpointPOST`/sendsms`### Required Parameters

[](#required-parameters)

NameTypeDescriptionuserstringUsernamesecret\_keystringAPI keytostringRecipient mobile numbermessagestringMessage body### Optional Calendar Fields (`is_calander = 1`)

[](#optional-calendar-fields-is_calander--1)

NameDescriptioncalander\_dateYYYY-MM-DDcalander\_timeHH:MMreminderMinutes before eventreminder\_textReminder messagelocation\_urlGoogle Maps URL### Example Usage

[](#example-usage)

```
DreamSms::sendSms(
    '966512345678',
    'Meeting at 5pm',
    [
        'is_calander'   => 1,
        'calander_date' => '2025-07-01',
        'calander_time' => '17:00',
        'reminder'      => 30,
        'reminder_text' => 'Don’t forget!',
    ]
);
```

### Response

[](#response)

- `SMS_ID:mobileNumber` on success
- Negative codes for errors (`-113` insufficient balance, `-119` invalid datetime, etc.)

---

3.10 `sendMulti(array $toWithMsg, string $sender): array`
---------------------------------------------------------

[](#310-sendmultiarray-towithmsg-string-sender-array)

**Description:** Send different messages to multiple recipients in one request.

HTTP MethodEndpointPOST`/sendsms_multi`### Parameters

[](#parameters-7)

NameTypeDescriptionuserstringUsernamesecret\_keystringAPI keytostringJSON: `{"9665...":"Msg1","9665...":"Msg2"}`### Example Usage

[](#example-usage-1)

```
DreamSms::sendMulti([
    '966512345678' => 'Hello Alice',
    '966512345679' => 'Hello Bob',
]);
```

### Response

[](#response-1)

Same format as single `sendSms` response.

---

4. Error Handling
=================

[](#4-error-handling)

Catch `DreamSms\LaravelDreamSms\Exceptions\DreamSmsException` to manage HTTP or API errors:

```
try {
    DreamSms::sendSms(...);
} catch (DreamSmsException $e) {
    report($e);
    // handle or display $e->getMessage()
}
```

---

6. Contributions
================

[](#6-contributions)

1. Fork and clone
2. Create a branch `feature/your-feature`
3. Write tests &amp; code
4. Submit a PR

Please follow PSR-12 and include tests for new methods.

---

7. License
==========

[](#7-license)

MIT. See [LICENSE](LICENSE).

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance87

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~61 days

Total

11

Last Release

65d ago

PHP version history (2 changes)v1.0.1PHP ^8.0

v1.0.3PHP ^7.4|^8.0|^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fb3960cf6e949bc5401902a09bf597da5bf4aeaf53c382bb55b1843769c0347?d=identicon)[Yacoub\_Al-haidari](/maintainers/Yacoub_Al-haidari)

---

Top Contributors

[![YacoubAl-hardari](https://avatars.githubusercontent.com/u/94101869?v=4)](https://github.com/YacoubAl-hardari "YacoubAl-hardari (19 commits)")

---

Tags

smssms-apisms-gatewaylaravelnotificationlaravel-packagesmsapi clientsms apisms sendingdreamsms

### Embed Badge

![Health badge](/badges/dreamsms-laravel-dreamsms/health.svg)

```
[![Health](https://phpackages.com/badges/dreamsms-laravel-dreamsms/health.svg)](https://phpackages.com/packages/dreamsms-laravel-dreamsms)
```

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
