PHPackages                             misaf/laravel-sms-gateway - 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. misaf/laravel-sms-gateway

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

misaf/laravel-sms-gateway
=========================

Driver-based SMS gateway manager for Laravel.

v3.0.0(1mo ago)1194[1 PRs](https://github.com/misaf/laravel-sms-gateway/pulls)12MITPHPPHP ^8.3CI passing

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/misaf/laravel-sms-gateway)[ Packagist](https://packagist.org/packages/misaf/laravel-sms-gateway)[ Docs](https://github.com/misaf/laravel-sms-gateway)[ RSS](/packages/misaf-laravel-sms-gateway/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (29)Versions (7)Used By (12)

Laravel SMS Gateway
===================

[](#laravel-sms-gateway)

A simple driver-based SMS gateway manager for Laravel.

Features
--------

[](#features)

- Separate packages for each provider.
- Switch drivers per request.
- Laravel HTTP client access.
- SMS sent events with request and response data.
- Custom driver registration.

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

[](#requirements)

- PHP 8.3+
- Laravel 13+

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

[](#installation)

Install the core package:

```
composer require misaf/laravel-sms-gateway
```

Install one or more driver packages:

```
composer require misaf/laravel-sms-gateway-ghasedak
```

Publish the config file:

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

Driver Packages
---------------

[](#driver-packages)

First-party driver packages:

DriverPackage`ghasedak`[`misaf/laravel-sms-gateway-ghasedak`](https://github.com/misaf/laravel-sms-gateway-ghasedak)`ippanel`[`misaf/laravel-sms-gateway-ippanel`](https://github.com/misaf/laravel-sms-gateway-ippanel)`kavenegar`[`misaf/laravel-sms-gateway-kavenegar`](https://github.com/misaf/laravel-sms-gateway-kavenegar)`magfa`[`misaf/laravel-sms-gateway-magfa`](https://github.com/misaf/laravel-sms-gateway-magfa)`melipayamak`[`misaf/laravel-sms-gateway-melipayamak`](https://github.com/misaf/laravel-sms-gateway-melipayamak)`messagebird`[`misaf/laravel-sms-gateway-messagebird`](https://github.com/misaf/laravel-sms-gateway-messagebird)`plivo`[`misaf/laravel-sms-gateway-plivo`](https://github.com/misaf/laravel-sms-gateway-plivo)`smsir`[`misaf/laravel-sms-gateway-smsir`](https://github.com/misaf/laravel-sms-gateway-smsir)`sunway`[`misaf/laravel-sms-gateway-sunway`](https://github.com/misaf/laravel-sms-gateway-sunway)`textlocal`[`misaf/laravel-sms-gateway-textlocal`](https://github.com/misaf/laravel-sms-gateway-textlocal)`twilio`[`misaf/laravel-sms-gateway-twilio`](https://github.com/misaf/laravel-sms-gateway-twilio)`vonage`[`misaf/laravel-sms-gateway-vonage`](https://github.com/misaf/laravel-sms-gateway-vonage)Quick Start
-----------

[](#quick-start)

Install the Ghasedak driver package:

```
composer require misaf/laravel-sms-gateway-ghasedak
```

Set the default driver in `.env`:

```
SMS_GATEWAY_DRIVER=ghasedak # Default driver
SMS_GATEWAY_GHASEDAK_APIKEY=your-api-key # Ghasedak API key
```

Add the matching service credentials in `config/services.php`:

```
'ghasedak' => [
    'api_key' => env('SMS_GATEWAY_GHASEDAK_APIKEY'),
],
```

Send through the default driver:

```
use Misaf\LaravelSmsGateway\Facade\SmsGateway;

$response = SmsGateway::driver()->send([
    'message'  => 'Hello',
    'receptor' => '09123456789',
]);
```

See the original provider documentation for available fields.

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

[](#configuration)

Set `SMS_GATEWAY_DRIVER` in your application's `.env` file to choose the default driver.

Provider environment keys are defined by each driver package — see that package's README (linked under [Driver Packages](#driver-packages)) for its variables.

### Switching Drivers

[](#switching-drivers)

Use `driver()` to send through a specific driver without changing the default:

```
SmsGateway::driver('ghasedak')->send($data);

SmsGateway::driver('kavenegar')->send($data);
```

### HTTP Client Access

[](#http-client-access)

Use `request()` to send directly through the configured Laravel HTTP client for a driver:

```
$response = SmsGateway::driver('ghasedak')
    ->request()
    ->post('sms/send/simple', $data);
```

Use either `send()` or `request()` — after calling `request()->post(...)`, you do not need to call `send()`.

Events
------

[](#events)

HTTP drivers dispatch `Misaf\LaravelSmsGateway\Events\SmsSent`.

```
use Misaf\LaravelSmsGateway\Events\SmsSent;

final class StoreSmsGatewayResult
{
    public function handle(SmsSent $event): void
    {
        $driver = $event->driverName;
        $url = $event->request->url();
        $status = $event->response->status();
        $body = $event->response->json();
    }
}
```

Event properties:

- `$driverName`: the resolved SMS gateway driver name.
- `$request`: the `Illuminate\Http\Client\Request` instance.
- `$response`: the `Illuminate\Http\Client\Response` instance.

Custom Drivers
--------------

[](#custom-drivers)

Custom drivers should extend `SmsGatewayDriver`, implement `send()`, and use `configureRequest()` for driver-specific HTTP client options.

The driver name is taken from the `extend()` registration key; it selects the `services.{name}` config section and labels `SmsSent` events. Override `driverName()` only when those should use a different name.

```
namespace App\SmsGateways;

use Illuminate\Http\Client\PendingRequest;
use Illuminate\Http\Client\Response;
use Misaf\LaravelSmsGateway\SmsGatewayDriver;

final class CustomDriver extends SmsGatewayDriver
{
    /**
     * @param array $data
     */
    public function send(array $data): Response
    {
        return $this->request()->post('messages', $data);
    }

    protected function defaultBaseUrl(): string
    {
        return 'https://api.example.com';
    }

    protected function configureRequest(PendingRequest $request): PendingRequest
    {
        return $request->withToken($this->driverConfig('token'));
    }
}
```

Register it from a service provider:

```
use App\SmsGateways\CustomDriver;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\ServiceProvider;
use Misaf\LaravelSmsGateway\Facade\SmsGateway;

final class AppServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        SmsGateway::extend('custom', function (Application $app): CustomDriver {
            return $app->make(CustomDriver::class);
        });
    }
}
```

Testing
-------

[](#testing)

```
composer test
composer analyse
```

Changelog
---------

[](#changelog)

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

License
-------

[](#license)

MIT

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance91

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.2% 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 ~52 days

Total

4

Last Release

45d ago

Major Versions

v1.0.0 → v2.0.02026-07-03

v2.0.0 → v3.0.02026-07-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/41fd7351d25e29dafa18068d0418eecf6bb47a7473aabe6bc674b4ca35e71805?d=identicon)[misaf](/maintainers/misaf)

---

Top Contributors

[![misaf](https://avatars.githubusercontent.com/u/8195685?v=4)](https://github.com/misaf "misaf (82 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelnotificationlaravel-packagesmsmessaginggatewaysms apisms-gatewaysms providersms driver

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/misaf-laravel-sms-gateway/health.svg)

```
[![Health](https://phpackages.com/badges/misaf-laravel-sms-gateway/health.svg)](https://phpackages.com/packages/misaf-laravel-sms-gateway)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

818355.4k3](/packages/defstudio-telegraph)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M227](/packages/laravel-mcp)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5226.7k](/packages/simplestats-io-laravel-client)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

46273.9k](/packages/harris21-laravel-fuse)

PHPackages © 2026

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