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.4.0(1mo ago)57366↓90.5%8[1 PRs](https://github.com/iRaziul/barta/pulls)MITPHPPHP ^8.2CI passing

Since Jan 29Pushed 1w 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 yesterday

READMEChangelog (6)Dependencies (36)Versions (10)Used By (0)

[![Barta is a Laravel package for integrating Bangladeshi SMS gateways.](.github/assets/cover.svg)](.github/assets/cover.svg)

Barta - Laravel package for integrating Bangladeshi SMS gateways
================================================================

[](#barta---laravel-package-for-integrating-bangladeshi-sms-gateways)

[![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)[![Laravel Compatibility](https://camo.githubusercontent.com/6eba9ca4d9440855529062db28d5fb45fa7b9ace86d3192131378f81342c4035/68747470733a2f2f62616467652e6c61726176656c2e636c6f75642f62616467652f6c6172616d656e742f6261727461)](https://packagist.org/packages/larament/barta)[![License](https://camo.githubusercontent.com/3d808031f512f833265ea3853d9ef98093756a390db7d9393a6651c3ee5b3c2e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6952617a69756c2f62617274612e7376673f7374796c653d666c61742d737175617265)](https://github.com/iRaziul/barta/blob/main/LICENSE.md)

Barta provides a clean, expressive way to send SMS from Laravel applications using Bangladeshi gateways. It gives you a single API for transactional messages, OTP delivery, alerts, queued sends, and notification-based messaging.

The package is designed to feel native in Laravel projects while keeping gateway-specific concerns isolated to drivers and configuration.

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

Supported Gateways
------------------

[](#supported-gateways)

- `log` driver for local development and testing
- Most Bangladeshi SMS gateways are supported

Full gateway list and setup instructions are available at [barta.larament.com/gateways](https://barta.larament.com/gateways/).

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 11 to 13

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

[](#installation)

Install via Composer:

```
composer require larament/barta
```

Optionally, you can run the install command:

```
php artisan barta:install
```

Quick Start
-----------

[](#quick-start)

Set your default driver in `.env`:

```
BARTA_DRIVER=log
```

Then send your first message:

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

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

Send through a specific gateway:

```
Barta::driver('DRIVER_NAME')
    ->to('01712345678')
    ->message('Hello from Larament Barta')
    ->send();
```

Queue a message for background delivery:

```
Barta::to('01712345678')
    ->message('Queued message')
    ->queue();
```

Send to multiple recipients:

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

Tip

Use the `log` driver during local development and automated tests to avoid sending real SMS.

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

[](#laravel-notifications)

Barta integrates with Laravel's notification system through the `barta` channel:

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

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

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

Route notifications to a phone number on your notifiable model:

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

Learn more at [barta.larament.com/advanced/notifications](https://barta.larament.com/advanced/notifications/).

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

[](#phone-number-formatting)

Barta automatically normalizes Bangladeshi mobile numbers into `8801XXXXXXXXX` format.

InputNormalized`01712345678``8801712345678``+8801712345678``8801712345678`Documentation
-------------

[](#documentation)

The full documentation lives at [barta.larament.com](https://barta.larament.com).

- Getting started: [barta.larament.com/usage/basic-usage](https://barta.larament.com/usage/basic-usage/)
- Gateway configuration: [barta.larament.com/gateways](https://barta.larament.com/gateways/)
- Notifications: [barta.larament.com/advanced/notifications](https://barta.larament.com/advanced/notifications/)

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.

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

51

—

FairBetter than 95% of packages

Maintenance95

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.4% 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 ~20 days

Total

6

Last Release

52d 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 (35 commits)")[![rtraselbd](https://avatars.githubusercontent.com/u/31556372?v=4)](https://github.com/rtraselbd "rtraselbd (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 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

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[vormkracht10/laravel-mails

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

24857.5k](/packages/vormkracht10-laravel-mails)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.3k3](/packages/defstudio-telegraph)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[backstage/laravel-mails

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

24884.4k11](/packages/backstage-laravel-mails)

PHPackages © 2026

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