定制 larament/barta 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

larament/barta

Composer 安装命令:

composer require larament/barta

包简介

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

README 文档

README

Barta is a Laravel package for integrating Bangladeshi SMS gateways.

Barta - Laravel package for integrating Bangladeshi SMS gateways

Latest Version on Packagist Total Downloads Run Tests PHPStan Laravel Compatibility License

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

  • 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

  • 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.

Requirements

  • PHP 8.2 or higher
  • Laravel 11 to 13

Installation

Install via Composer:

composer require larament/barta

Optionally, you can run the install command:

php artisan barta:install

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

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.

Phone Number Formatting

Barta automatically normalizes Bangladeshi mobile numbers into 8801XXXXXXXXX format.

Input Normalized
01712345678 8801712345678
+8801712345678 8801712345678

Documentation

The full documentation lives at barta.larament.com.

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

See CHANGELOG.md for recent changes.

Contributing

See CONTRIBUTING.md for details.

Security

Report vulnerabilities via our security policy.

Credits

License

MIT License. See LICENSE.md.

Made with ❤️ for the Bangladeshi Laravel Community

⭐ Star us on GitHub

larament/barta 适用场景与选型建议

larament/barta 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 365 次下载、GitHub Stars 达 57, 最近一次更新时间为 2026 年 01 月 31 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「sms」 「sms api」 「sms provider」 「sms gateway」 「bangladesh」 「sms sender」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 larament/barta 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 larament/barta 我们能提供哪些服务?
定制开发 / 二次开发

基于 larament/barta 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 365
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 57
  • 点击次数: 33
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 57
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-31