PHPackages                             ecare/sms - 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. ecare/sms

ActiveLibrary

ecare/sms
=========

Laravel package for Ecare SMS API integration

v1.0.2(1mo ago)02↑2900%MITPHPPHP ^8.0

Since Mar 27Pushed 1mo agoCompare

[ Source](https://github.com/ecaresolutions/ecaresms-laravel-library)[ Packagist](https://packagist.org/packages/ecare/sms)[ Docs](https://ecaresms.com)[ RSS](/packages/ecare-sms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Ecare SMS Laravel Package
=========================

[](#ecare-sms-laravel-package)

**Version:** 1.0.0

A comprehensive Laravel package for integrating the Ecare SMS API. Send SMS messages, manage campaigns, and track message status programmatically.

Features
--------

[](#features)

- ✅ Send SMS to single or multiple recipients
- ✅ Send SMS campaigns using contact lists
- ✅ Retrieve SMS and campaign details
- ✅ View all messages with pagination
- ✅ Laravel Facade support
- ✅ Easy configuration
- ✅ Fluent API design

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
composer require ecare/sms
```

### Installation

[](#installation-1)

1. **Publish the configuration file:**

```
php artisan vendor:publish --tag=ecaresms-config
```

2. **Update your `.env` file:**

```
ECARE_SMS_API_TOKEN=your_api_token_here
ECARE_SMS_SENDER_ID=YourCompanyName
ECARE_SMS_TIMEOUT=30
ECARE_SMS_BASE_URL_V3=https://send.ecaresms.com/api/v3
ECARE_SMS_BASE_URL_HTTP=https://send.ecaresms.com/api/http
```

Usage
-----

[](#usage)

### Basic Setup

[](#basic-setup)

The package is automatically registered in Laravel 5.5+. If you're using an older version, add the service provider to your `config/app.php`:

```
'providers' => [
    // ...
    EcareSms\EcareSmsServiceProvider::class,
],

'aliases' => [
    // ...
    'EcareSms' => EcareSms\Facades\EcareSms::class,
]
```

### Sending SMS

[](#sending-sms)

#### Send to Single Recipient

[](#send-to-single-recipient)

```
use EcareSms\Facades\EcareSms;

$response = EcareSms::sendSms(
    recipient: '31612345678',
    senderID: 'YourName',
    message: 'This is a test message'
);

// Response structure
// {
//     "status": "success",
//     "data": "sms reports with all details"
// }
```

#### Send to Multiple Recipients

[](#send-to-multiple-recipients)

```
$response = EcareSms::sendSms(
    recipient: '31612345678,8801721970168',
    senderID: 'YourName',
    message: 'This is a test message'
);
```

#### Send with Scheduled Time

[](#send-with-scheduled-time)

```
$response = EcareSms::sendSms(
    recipient: '31612345678',
    senderID: 'YourName',
    message: 'This is a scheduled message',
    options: [
        'schedule_time' => '2021-12-20 07:00'
    ]
);
```

#### Send with DLT Template

[](#send-with-dlt-template)

```
$response = EcareSms::sendSms(
    recipient: '31612345678',
    senderID: 'YourName',
    message: 'This is a DLT message',
    options: [
        'dlt_template_id' => 'your_template_id'
    ]
);
```

### Sending Campaigns

[](#sending-campaigns)

#### Send to Contact List

[](#send-to-contact-list)

```
$response = EcareSms::sendCampaign(
    contactListID: '6415907d0d37a',
    senderID: 'YourName',
    message: 'Campaign message to contact list'
);
```

#### Send Campaign to Multiple Contact Lists

[](#send-campaign-to-multiple-contact-lists)

```
$response = EcareSms::sendCampaign(
    contactListID: '6415907d0d37a,6415907d0d7a6',
    senderID: 'YourName',
    message: 'Campaign message'
);
```

#### Send Scheduled Campaign

[](#send-scheduled-campaign)

```
$response = EcareSms::sendCampaign(
    contactListID: '6415907d0d37a',
    senderID: 'YourName',
    message: 'Scheduled campaign',
    options: [
        'schedule_time' => '2021-12-20 07:00'
    ]
);
```

### Retrieving Messages

[](#retrieving-messages)

#### Get Single SMS by ID

[](#get-single-sms-by-id)

```
$response = EcareSms::getSms('606812e63f78b');

// Response
// {
//     "status": "success",
//     "data": "sms data with all details"
// }
```

#### Get All Messages

[](#get-all-messages)

```
$response = EcareSms::getAllMessages();

// Response
// {
//     "status": "success",
//     "data": "sms reports with pagination"
// }
```

#### Get Campaign Details

[](#get-campaign-details)

```
$response = EcareSms::getCampaign('606812e63f78b');

// Response
// {
//     "status": "success",
//     "data": "campaign data with all details"
// }
```

### Dependency Injection

[](#dependency-injection)

Use dependency injection in your controllers and services:

```
