PHPackages                             larament/barta - 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. larament/barta

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

larament/barta
==============

Barta is a Laravel package designed to integrate popular Bangladeshi SMS gateways seamlessly.

v1.2.1(3mo ago)56157↓43.8%7MITPHPPHP ^8.2CI passing

Since Jan 29Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/iRaziul/barta)[ Packagist](https://packagist.org/packages/larament/barta)[ Docs](https://github.com/iRaziul/barta)[ GitHub Sponsors](https://github.com/iRaziul)[ RSS](/packages/larament-barta/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (12)Versions (6)Used By (0)

Barta (কথা) - The unified interface for every Bangladeshi SMS gateway.
======================================================================

[](#barta-কথা---the-unified-interface-for-every-bangladeshi-sms-gateway)

[![Barta Banner](https://raw.githubusercontent.com/iRaziul/barta/main/.github/assets/banner.svg)](https://github.com/iRaziul/barta)
[![Latest Version on Packagist](https://camo.githubusercontent.com/98e309f805954d8b3e4e20f13eca397b8ef3eab39e6c5ae8eead917bea46fb7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6172616d656e742f62617274612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/larament/barta)[![Total Downloads](https://camo.githubusercontent.com/7d34ff444c6fd3a1beda32fca66a3fe6cb1e0ec2fa8cf4e9993b5495d2357515/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6172616d656e742f62617274612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/larament/barta)[![Run Tests](https://github.com/iRaziul/barta/actions/workflows/run-tests.yml/badge.svg)](https://github.com/iRaziul/barta/actions/workflows/run-tests.yml)[![PHPStan](https://github.com/iRaziul/barta/actions/workflows/phpstan.yml/badge.svg)](https://github.com/iRaziul/barta/actions/workflows/phpstan.yml)[![Pint](https://github.com/iRaziul/barta/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/iRaziul/barta/actions/workflows/fix-php-code-style-issues.yml)[![License](https://camo.githubusercontent.com/3d808031f512f833265ea3853d9ef98093756a390db7d9393a6651c3ee5b3c2e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6952617a69756c2f62617274612e7376673f7374796c653d666c61742d737175617265)](https://github.com/iRaziul/barta/blob/main/LICENSE.md)

---

Introduction
------------

[](#introduction)

Barta is a clean, expressive Laravel package designed to integrate popular Bangladeshi SMS gateways seamlessly. Whether you're sending OTPs, marketing alerts, or notifications, Barta makes the process as simple as a conversation.

Key Features
------------

[](#key-features)

- **Multiple Gateways** — Seamlessly switch between SMS providers
- **Bulk SMS** — Send to multiple recipients in a single call
- **Queue Support** — Dispatch SMS to background jobs
- **Laravel Notifications** — Native integration with Laravel's notification system
- **BD Phone Formatting** — Automatic phone number normalization to `8801XXXXXXXXX` format
- **Extensible** — Create custom drivers for any SMS gateway

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

[](#installation)

Install via Composer:

```
composer require larament/barta
```

Optionally, you can run the install command:

```
php artisan barta:install
```

---

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

[](#configuration)

Set your default driver and add credentials to `.env`:

```
BARTA_DRIVER=log
```

Each gateway requires different credentials. See [Gateways](https://barta.larament.com/gateways/) for all available options and environment variable names.

Tip

Use `log` driver during development to avoid sending real SMS.

---

Usage
-----

[](#usage)

```
use Larament\Barta\Facades\Barta;

// Send SMS
Barta::to('01712345678')
    ->message('Your OTP is 1234')
    ->send();

// Use a specific gateway
Barta::driver('DRIVER_NAME')
    ->to('01712345678')
    ->message('Hello!')
    ->send();

// Bulk SMS
Barta::to(['01712345678', '01812345678'])
    ->message('Hello everyone!')
    ->send();

// Queue for background processing
Barta::to('01712345678')
    ->message('Queued message')
    ->queue();
```

📚 **[Full Usage Guide →](https://barta.larament.com/usage/basic-usage/)**

---

Laravel Notifications
---------------------

[](#laravel-notifications)

```
use Larament\Barta\Notifications\BartaMessage;

class OrderShipped extends Notification
{
    public function via($notifiable): array
    {
        return ['barta'];
    }

    public function toBarta($notifiable): BartaMessage
    {
        return new BartaMessage("Your order has been shipped!");
    }
}
```

Add the route to your model:

```
public function routeNotificationForBarta($notification): string
{
    return $this->phone;
}
```

📚 **[Full Notifications Guide →](https://barta.larament.com/advanced/notifications/)**

---

Phone Number Formatting
-----------------------

[](#phone-number-formatting)

Barta automatically normalizes Bangladeshi phone numbers to `8801XXXXXXXXX` format:

InputOutput`01712345678``8801712345678``+8801712345678``8801712345678`---

Testing
-------

[](#testing)

```
composer test          # Run tests
composer test-coverage # With coverage
composer analyse       # Static analysis
```

Use the `log` driver during testing to avoid sending real SMS.

---

Documentation
-------------

[](#documentation)

For complete documentation including custom drivers, error handling, and all gateway configurations:

**📚 [barta.larament.com](https://barta.larament.com)**

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for recent changes.

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for details.

Security
--------

[](#security)

Report vulnerabilities via our [security policy](.github/SECURITY.md).

Credits
-------

[](#credits)

- [Raziul Islam](https://github.com/iRaziul)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT License. See [LICENSE.md](LICENSE.md).

---

Made with ❤️ for the Bangladeshi Laravel Community

[⭐ Star us on GitHub](https://github.com/iRaziul/barta/stargazers)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance85

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87% 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 ~1 days

Total

4

Last Release

104d ago

PHP version history (2 changes)v1.0.0PHP ^8.4

v1.2.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c371b774feadb3bfc182f9309ab6aeac6789b993ac63a213fe3aca070f95100d?d=identicon)[Raziul](/maintainers/Raziul)

---

Top Contributors

[![iRaziul](https://avatars.githubusercontent.com/u/51883557?v=4)](https://github.com/iRaziul "iRaziul (20 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![rtraselbd](https://avatars.githubusercontent.com/u/31556372?v=4)](https://github.com/rtraselbd "rtraselbd (1 commits)")

---

Tags

bartalaravelsms-gatewaysms-gateway-bangladeshsmssms apisms-gatewaysms sendersms providerbangladeshSMS Servicesms notificationbartasms gateway bangladeshsms api bangladeshsms service bangladeshsms provider bangladeshsms notification bangladeshsms sender bangladesh

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/larament-barta/health.svg)

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

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[wnx/laravel-sends

Keep track of outgoing emails in your Laravel application.

200427.3k](/packages/wnx-laravel-sends)[ghasedak/php

ghasedak sms gateway package for PHP

2044.3k7](/packages/ghasedak-php)

PHPackages © 2026

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