PHPackages                             gabeta/laravel-custom-sms-channels - 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. gabeta/laravel-custom-sms-channels

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

gabeta/laravel-custom-sms-channels
==================================

Channels SMS notification for providers not supported by laravel by default.

v0.0.1(3y ago)8592[2 PRs](https://github.com/gabeta/laravel-custom-sms-channels/pulls)MITBladePHP ^7.4|^8.0|^8.1

Since Jul 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/gabeta/laravel-custom-sms-channels)[ Packagist](https://packagist.org/packages/gabeta/laravel-custom-sms-channels)[ Docs](https://github.com/gabeta/laravel-custom-sms-channels)[ RSS](/packages/gabeta-laravel-custom-sms-channels/feed)WikiDiscussions 0.x Synced 1mo ago

READMEChangelog (1)Dependencies (16)Versions (5)Used By (0)

Laravel custom sms channels
===========================

[](#laravel-custom-sms-channels)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9a90a55d78f5c9f1faed3243fb982a5ce89ea162d01f79ff0eb40cc3b01b1848/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6761626574612f6c61726176656c2d637573746f6d2d736d732d6368616e6e656c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gabeta/laravel-custom-sms-channels)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b30f7d8c2e14f6396c493e16d9f5d297e5fb1b2f21deb8506eba2c685ad3b31d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6761626574612f6c61726176656c2d637573746f6d2d736d732d6368616e6e656c732f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/gabeta/laravel-custom-sms-channels/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/4a5cc0650d9974a562cf1125b9d3820585201bb6f5bc9345d2905b37ba1b147f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6761626574612f6c61726176656c2d637573746f6d2d736d732d6368616e6e656c732f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/gabeta/laravel-custom-sms-channels/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c3bdbc32eb112bfb6317980dbf6b7ddd769225f42b1f4d70d16dd7562c8dfdf0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6761626574612f6c61726176656c2d637573746f6d2d736d732d6368616e6e656c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gabeta/laravel-custom-sms-channels)

Laravel notification channels package for a few SMS providers. The specificity of this package is that you can combine several SMS sending services (supported by the package) in the same project without adding additional code. Have you always wanted to receive your SMS locally? preview them make consequent adjustments? We also offer you this functionality.

[![Preview Dashbaord](/art/bg-ios.png "Laravel custom sms channel preview dashboard")](/art/bg-ios.png)

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

[](#installation)

You can install the package via composer:

```
composer require gabeta/laravel-custom-sms-channels
```

You can publish the config file with:

```
php artisan vendor:publish --provider="Gabeta\CustomSmsChannels\CustomSmsChannelsServiceProvider" --tag="config"
```

### Setting up your SMS provider

[](#setting-up-your-sms-provider)

```
'default' => env('CUSTOM_SMS_CHANNEL', 'sms_log'),

'preview' => [
    'enable' => env('ENABLE_SMS_PREVIEW', true),

    'domain' => null,

    'path' => '/customs-sms-dashboard',
],

'providers' => [

    'sms_log' => [
        'config' => [
            'driver' => 'single',
            'path' => storage_path('logs/custom-sms.log'),
            'level' => 'info',
        ],
    ],

    'infobip' => [
        'send_from' => env('INFOBIP_SEND_FROM'),

        'api_host' => env('INFOBIP_API_HOST'),

        'api_key_prefix' => env('INFOBIP_API_KEY_PREFIX'),

        'api_key' => env('INFOBIP_API_KEY'),
    ]

    ....
]
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use Illuminate\Notifications\Notification;

class WelcomeNotification extends Notification
{
    public function via($notifiable)
    {
        return ['customsms'];
    }

    public function toCustomSms($notifiable)
    {
        return "Hello Laravel Community from Ivory Coast (Côte D'ivoire)";
    }
}
```

The `customsms` channel will automatically use the provider you have defined by default in your configuration file. It should be noted that a channel will be created for each provider supported by the package. [See the list of channels supported](https://github.com/gabeta/laravel-custom-sms-channels#provider-supporter-and-those-we-intend-to-implement).

In order to let your Notification know which user(s) phone number you are targeting, add the `routeNotificationForCustomSms` method to your Notifiable model. The `routeNotificationForCustomSms` method must return an instance of `Gabeta\CustomSmsChannels\PhoneNumber`.

```
use Gabeta\CustomSmsChannels\Facades\PhoneNumber;

public function routeNotificationForCustomSms()
{
    return PhoneNumber::setDialCode($this->dial_code)
                ->setPhone($this->phone);
}
```

In the example above (the dial code and number are stored in separate fields) we return an instance of `Gabeta\CustomSmsChannels\PhoneNumber` while setting the `dial_code` without any prefix (`+` or `00`) and the phone number. There are providers that use the dial code and number without a prefix to send SMS others use the `+` or `00` prefix. The system will take care of the formatting according to of each provider. If the number and dial code are stored in the same field you can set with method.

```
use Gabeta\CustomSmsChannels\Facades\PhoneNumber;

public function routeNotificationForCustomSms()
{
    return PhoneNumber::setRouteNotification($this->full_phone_number);
}
```

We advise you to provide the telephone number without the prefix. As mentioned above top the system will take care of the prefixing according to the provider.

### Preview SMS Localy

[](#preview-sms-localy)

To preview your SMS locally use the `sms_log` driver activate the preview in your config file.

Publish dashboard assets:

```
php artisan vendor:publish --provider="Gabeta\CustomSmsChannels\CustomSmsChannelsServiceProvider" --tag="public"
```

Go to: **http://YOUR\_HOST/customs-sms-dashboard** for preview your SMS.

### Provider supporter

[](#provider-supporter)

Providerschannelvia methodroute notification methodlog ✅logtoLogSmsrouteNotificationForLogSmsinfobip ✅infobiptoInfobiprouteNotificationForInfobiptwilio ✅twiliotoTwiliorouteNotificationForTwilioYou could use via or route notification method if you want behavior channel-specific. The package tries to find the via method and the route notification method specific to its provider if it does not find it it will call the `routeNotificationForCustomSms` functions and `toCustomSms`.

Would you like to combine a notification channel package such as [Laravel vonage](https://github.com/laravel/vonage-notification-channel) package with our package ? Yes it is possible. you must first install their package then add their channel with null value in the supported provider in the config file.

Example:

```
'providers' => [
    'vonage' => null
]
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Gabeta Soro](https://github.com/gabeta)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.8% 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 ~355 days

Total

2

Last Release

1027d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16475656?v=4)[Gabeta Soro](/maintainers/gabeta)[@gabeta](https://github.com/gabeta)

---

Top Contributors

[![gabeta](https://avatars.githubusercontent.com/u/16475656?v=4)](https://github.com/gabeta "gabeta (45 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")[![Ange0](https://avatars.githubusercontent.com/u/45317331?v=4)](https://github.com/Ange0 "Ange0 (2 commits)")

---

Tags

laravelnotificationsmsInfobiplaravel-custom-sms-channels

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/gabeta-laravel-custom-sms-channels/health.svg)

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

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[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)[ghanem/laravel-smsmisr

Send SMS and SMS Notification via SMS Misr for Laravel

194.8k](/packages/ghanem-laravel-smsmisr)

PHPackages © 2026

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