PHPackages                             anhtuan92na/fpt-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. [API Development](/categories/api)
4. /
5. anhtuan92na/fpt-sms

ActiveLibrary[API Development](/categories/api)

anhtuan92na/fpt-sms
===================

FPT SMS API integration for Laravel

v1.0.0(1w ago)00MITPHPPHP ^8.1

Since Mar 15Pushed 1w agoCompare

[ Source](https://github.com/tuanta1992/laravel-fpt-sms)[ Packagist](https://packagist.org/packages/anhtuan92na/fpt-sms)[ RSS](/packages/anhtuan92na-fpt-sms/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Laravel FPT SMS
===============

[](#laravel-fpt-sms)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ee6e7290d2a56ee72bd898dfef89f7ffa5d3e7a707b5d6c44a03d3fb746c4935/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e687475616e39326e612f6670742d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anhtuan92na/fpt-sms)[![Total Downloads](https://camo.githubusercontent.com/4cb8c4dc1d1e6ea1003c6f78c6bf763202b73195db03d5c5300ada65fea2d7ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e687475616e39326e612f6670742d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anhtuan92na/fpt-sms)[![License](https://camo.githubusercontent.com/de0fa637b35ed58bb19cf15e14df6ad1ae9c14a9b6476103d1fd06f919faaaf3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616e687475616e39326e612f6670742d736d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/anhtuan92na/fpt-sms)

A Laravel package for integrating with the [FPT SMS](http://service.sms.fpt.net) API. Supports sending brandname SMS, OTP, advertising campaigns, and more.

Features
--------

[](#features)

- Send Brandname SMS (OTP, Ads, Priority)
- Send MT Active SMS (standard &amp; priority)
- Create &amp; manage advertising campaigns
- Automatic access token caching (file, Redis, Memcached)
- Sandbox &amp; Production mode
- Built-in logging
- Artisan commands for testing &amp; monitoring
- Facade and Dependency Injection support

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Laravel &gt;= 10.0

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

[](#installation)

```
composer require anhtuan92na/fpt-sms
```

Publish the config file:

```
php artisan vendor:publish --tag=fpt-sms-config
```

Configuration
-------------

[](#configuration)

Add the following variables to your `.env` file:

```
FPT_SMS_CLIENT_ID=your_client_id
FPT_SMS_CLIENT_SECRET=your_client_secret
FPT_SMS_MODE=sandbox
FPT_SMS_TIMEOUT=30
FPT_SMS_CACHE=true
FPT_SMS_CACHE_DRIVER=file
FPT_SMS_LOG=true
FPT_SMS_LOG_CHANNEL=stack
```

KeyDefaultDescription`FPT_SMS_CLIENT_ID``''`FPT Client ID`FPT_SMS_CLIENT_SECRET``''`FPT Client Secret`FPT_SMS_MODE``sandbox`API mode: `sandbox` or `live``FPT_SMS_TIMEOUT``30`Connection timeout (seconds)`FPT_SMS_CACHE``true`Enable access token caching`FPT_SMS_CACHE_DRIVER``file`Cache driver (file, redis, memcached)`FPT_SMS_LOG``true`Enable request logging`FPT_SMS_LOG_CHANNEL``stack`Laravel log channelVerify your configuration:

```
php artisan fpt-sms:status
```

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use FptSms\Facades\FptSms;

// Send OTP
$result = FptSms::sendBrandnameOtp('BrandName', '0912345678', 'Your OTP code is: 123456');

// Send advertising SMS
$result = FptSms::sendBrandnameAds('CAMPAIGN_CODE', '0912345678,0987654321');

// Create a campaign
$result = FptSms::createCampaign('BrandName', 'Campaign 1', 'Message content', '2025-12-01 08:00:00', 1000);
```

### Dependency Injection

[](#dependency-injection)

```
use FptSms\FptSmsClient;

class NotificationService
{
    public function __construct(
        private FptSmsClient $fptSms
    ) {}

    public function sendOrderConfirmation($order)
    {
        return $this->fptSms->sendBrandnameOtp(
            'ShopName',
            $order->customer->phone,
            "Order #{$order->id} has been confirmed"
        );
    }
}
```

### Queue Job

[](#queue-job)

```
use FptSms\FptSmsClient;

class SendSmsJob implements ShouldQueue
{
    use InteractsWithQueue, Queueable;

    public function __construct(
        public string $phone,
        public string $message
    ) {}

    public function handle(FptSmsClient $fptSms)
    {
        $fptSms->sendBrandnameOtp('BrandName', $this->phone, $this->message);
    }
}

// Dispatch
SendSmsJob::dispatch('0912345678', 'Hello')->onQueue('sms');
```

API Methods
-----------

[](#api-methods)

MethodDescription`sendBrandnameOtp(brandName, phone, message)`Send OTP SMS via brandname`sendBrandnameAds(campaignCode, phoneList)`Send advertising SMS to a phone list`createCampaign(brandName, campaignName, message, scheduleTime, quota)`Create an advertising campaignArtisan Commands
----------------

[](#artisan-commands)

CommandDescription`php artisan fpt-sms:status`Check configuration status`php artisan fpt-sms:test`Send a test SMS`php artisan fpt-sms:clear-cache`Clear cached access tokenChangelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 86% of packages

Maintenance98

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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

Unknown

Total

1

Last Release

7d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e379f56f9897623b3dccd30a640011ce6ed9ea89aa5f046c23c347af100550f?d=identicon)[tuanta1992](/maintainers/tuanta1992)

---

Top Contributors

[![tuantalangtech](https://avatars.githubusercontent.com/u/236983165?v=4)](https://github.com/tuantalangtech "tuantalangtech (2 commits)")[![tuanta1992](https://avatars.githubusercontent.com/u/166894166?v=4)](https://github.com/tuanta1992 "tuanta1992 (1 commits)")

---

Tags

laravelotpsmsfptbrandname

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/anhtuan92na-fpt-sms/health.svg)

```
[![Health](https://phpackages.com/badges/anhtuan92na-fpt-sms/health.svg)](https://phpackages.com/packages/anhtuan92na-fpt-sms)
```

###  Alternatives

[ardakilic/mutlucell

Mutlucell SMS API wrapper for sending sms text messages for Laravel

457.3k](/packages/ardakilic-mutlucell)[vahidkaargar/bamboo-card-portal

This is Bamboocardportal.com package

161.9k](/packages/vahidkaargar-bamboo-card-portal)

PHPackages © 2026

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