PHPackages                             tookantech/chapaar - 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. tookantech/chapaar

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

tookantech/chapaar
==================

This package provides a flexible way to send and verify messages through various SMS providers. It offers integration with multiple drivers, making it easy to use different SMS service providers without getting locked into a specific one.

1.8.4(7mo ago)134504[1 PRs](https://github.com/TookanTech/chapaar/pulls)MITPHPPHP ^8.1 | ^8.2CI passing

Since Aug 5Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/TookanTech/chapaar)[ Packagist](https://packagist.org/packages/tookantech/chapaar)[ Docs](https://github.com/TookanTech/chapaar)[ RSS](/packages/tookantech-chapaar/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (21)Used By (0)

Chapaar | flexible way to send SMS through various SMS providers
================================================================

[](#chapaar--flexible-way-to-send-sms-through-various-sms-providers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cab3ccfd4f69f6c9a4c6cf51eb0c6bc4672a0c78bdcaf36c253aa8b5b40719f1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f546f6f6b616e546563682f636861706161722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/TookanTech/chapaar)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6e0f1f486dec182e6347478f6cc4fda24d402c0c8ce2e56e5aa0098f2a58e932/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f546f6f6b616e546563682f636861706161722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/TookanTech/chapaar/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/88a2dbec3effcd47c63f35c935140250358cb0e5a6c23fdea2085598e38313c0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f546f6f6b616e546563682f636861706161722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/TookanTech/chapaar/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3b4b9b8b7e267c904e515084d2e432011f5551fe5b3fd3fa1862ef212e65be33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f546f6f6b616e546563682f636861706161722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/TookanTech/chapaar)

Chapaar offers flexible message sending and verification through multiple SMS providers, with easy integration and no lock-in to any specific provider.

Available Drivers
-----------------

[](#available-drivers)

- [kavenegar.com](https://kavenegar.com/) (tested)
- [sms.ir](https://sms.ir/) (tested)
- [ghasedak.me](https://ghasedak.me/) (tested)
- [Farapayamk](https://farapayamak.ir/) (not tested)
- Twillo (coming soon)

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

[](#installation)

You can install the package via Composer:

```
composer require tookantech/chapaar
```

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

[](#configuration)

You can publish the config file with:

```
php artisan vendor:publish --tag="chapaar-config"
```

This will create a chapaar.php configuration file in your config directory, where you can set the default driver and configure driver-specific settings.

This is the contents of the published config file:

```
return [
    'default' => env('CHAPAAR_DRIVER', 'kavenegar'),

    'drivers' => [
        'kavenegar' => [
            'url' => 'https://api.kavenegar.com/v1/',
            'api_key' => '',
            'line_number' => ''
        ],
        'smsir' => [
            'url' => 'https://api.sms.ir/v1/',
            'api_key' => '',
            'line_number' => '',
        ],
        'ghasedak' => [
            'url'         => 'https://api.ghasedak.me/v2/',
            'api_key'     => '',
            'line_number' => '',
        ],
    ],
];
```

Usage
-----

[](#usage)

Using the Chapaar Facade

If you want to use the Chapaar package without Laravel's built-in notification system, you can utilize the Chapaar facade directly. This allows you to send and verify messages using different SMS providers.

Sending a Simple Message

```
use TookanTech\Chapaar\Facades\Chapaar;
use TookanTech\Chapaar\SmsMessage;

$message = (new SmsMessage())->driver()
    ->setFrom('12345678')
    ->setTo('0912111111')
    ->setContent('Hello, this is a test message.');

$response = Chapaar::send($message);
```

Sending With Template Message

```
use TookanTech\Chapaar\Facades\Chapaar;
use TookanTech\Chapaar\SmsMessage;

#Kavenegar
$message =(new SmsMessage())
    ->driver()
    ->setTemplate("invoice-paid")
    ->setTo('09121111111')
    ->setTokens([
        '123', // token
        '456', // token2
        '789', // token3
        '111', // token10, with 4 space
        '222', // token20, with 8 space
    ]);

# SmsIr
$message =(new SmsMessage())
    ->driver()
    ->setTemplate('invoice-paid')
    ->setTo('09121111111')
    ->setTokens([
        'code' => '123' // 'variable_name' => 'value'
    ]);

# Ghasedak
$message =(new SmsMessage())
    ->driver()
    ->setTemplate("invoice-paid")
    ->setTo('09121111111')
    ->setTokens([
        'test1', // param1
        'test2'  // param2
    ]);

$response = Chapaar::verify($message);
```

Sending Without using default driver

```
use TookanTech\Chapaar\Facades\Chapaar;
use TookanTech\Chapaar\SmsMessage;
use TookanTech\Chapaar\Enums\Drivers;

$message = (new SmsMessage())
    ->driver(Drivers::SMSIR)
    ->setFrom('12345678')
    ->setTo('0912111111')
    ->setContent('Hello, this is a test message.');

$response = Chapaar::send($message);
```

Get Latest Outbox messages it automatically get the latest sent messages for default driver

```
$response = Chapaar::outbox(100);
```

Using In Notifications
----------------------

[](#using-in-notifications)

Please review [laravel notifications](https://laravel.com/docs/10.x/notifications) on how use notifications in laravel.

```
use TookanTech\Chapaar\SmsChannel;
class InvoicePaid extends KavenegarBaseNotification
{
    public function via($notifiable): array
    {
        return [SmsChannel::class];
    }
    public function toSms($notifiable)
    {
        return (new SmsMessage)->driver()
        ->setTemplate('verify')
        ->setTokens([123],[456])
    }
}

class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForSms($driver, $notification = null)
    {
        return $this->mobile;
    }

}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [tookantech](https://github.com/TookanTech)

License
-------

[](#license)

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

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance63

Regular maintenance activity

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 82.3% 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 ~41 days

Recently: every ~134 days

Total

20

Last Release

225d ago

Major Versions

0.0.1 → 1.1.02023-08-10

PHP version history (3 changes)0.0.1PHP ^8.1

1.7.0PHP ^8.2|^8.1

1.8.2PHP ^8.1 | ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f273e450e9053b279301b708ae5fc6d5f477ea86960d224284f4b068efcc19c?d=identicon)[aryala77](/maintainers/aryala77)

![](https://avatars.githubusercontent.com/u/4539542?v=4)[TookanTech | توکان‌تک](/maintainers/tookantech)[@tookantech](https://github.com/tookantech)

---

Top Contributors

[![aryala7](https://avatars.githubusercontent.com/u/56627259?v=4)](https://github.com/aryala7 "aryala7 (135 commits)")[![miladnouri](https://avatars.githubusercontent.com/u/3003901?v=4)](https://github.com/miladnouri "miladnouri (16 commits)")[![alissn](https://avatars.githubusercontent.com/u/26966142?v=4)](https://github.com/alissn "alissn (8 commits)")[![Aryalav](https://avatars.githubusercontent.com/u/157987983?v=4)](https://github.com/Aryalav "Aryalav (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelsmslaravelnotificationsmskavenegarGhasedaksmsirfarapayamakfarazsmschapaarTookanTechtwillo

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tookantech-chapaar/health.svg)

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

###  Alternatives

[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[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)[spatie/laravel-mailcoach-sdk

An SDK to easily work with the Mailcoach API in Laravel apps

41290.2k1](/packages/spatie-laravel-mailcoach-sdk)[gr8shivam/laravel-sms-api

A modern, flexible Laravel package for integrating any SMS gateway with REST API support

10138.4k](/packages/gr8shivam-laravel-sms-api)[hooman-mirghasemi/laravel-iran-sms

Laravel Sms

241.8k](/packages/hooman-mirghasemi-laravel-iran-sms)

PHPackages © 2026

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