Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sms

> 后端框架
Open source

Laravel SMS Gateway Integration Package

318 stars0 likes1 views
WebsiteGitHub

About

Laravel SMS Gateway Integration Package

:gift: Laravel SMS Gateway

This is a Laravel Package for SMS Gateway Integration. Now sending SMS is easy and reliable.

List of supported gateways:

  • AWS SNS

  • Textlocal

  • Twilio

  • Clockwork

  • LINK Mobility

  • Kavenegar

  • Melipayamak

  • Melipayamakpattern

  • Smsir

  • Tsms

  • Farazsms

  • Farazsmspattern

  • SMS Gateway Me

  • SmsGateWay24

  • Ghasedak

  • Sms77

  • SabaPayamak

  • LSim

  • Rahyabcp

  • Rahyabir

  • D7networks

  • Hamyarsms

  • SMSApi

  • Others are under way.

:package: Install

Via Composer

bash
$ composer require tzsk/sms

:zap: Configure

Publish the configuration file:

bash
$ php artisan sms:publish

In the configuration file, you can set the default driver to use for sending your SMS messages. However, you can also seamlessly change the driver at runtime.

Choose the gateway you would like to use for your application. Then, set it as the default driver so that you do not have to specify it every time. You can also configure and use multiple gateways within the same project.

php
// Eg. if you want to use SNS.
'default' => 'sns',

Then fill the credentials for that gateway in the drivers array.

php
// Eg. for SNS.
'drivers' => [
    'sns' => [
        // Fill all the credentials here.
        'key' => 'Your AWS SNS Access Key',
        'secret' => 'Your AWS SNS Secret Key',
        'region' => 'Your AWS SNS Region',
        'from' => 'Your AWS SNS Sender ID', //sender
        'type' => 'Tansactional', // Or: 'Promotional'
    ],
    ...
]

Textlocal Configuration:

Textlocal is added by default. You simply need to update the credentials in the textlocal driver section.

AWS SNS Configuration:

If you want to use AWS SNS, you must install the required composer library first:

bash
composer require aws/aws-sdk-php

Clockwork Configuration:

If you want to use Clockwork, you must install the required composer library first:

bash
composer require mediaburst/clockworksms

Twilio Configuration:

If you want to use Twilio, you must install the required composer library first:

bash
composer require twilio/sdk

Then, simply update the credentials in the twilio driver section.

Melipayamak or Melipayamakpattern Configuration:

If you want to use Melipayamak or Melipayamakpattern, you must install the required composer library first:

bash
composer require melipayamak/php

Kavenegar Configuration:

If you want to use Kavenegar, you must install the required composer library first:

bash
composer require kavenegar/php

SMS Gateway Me Configuration:

If you want to use SMS Gateway Me, you must install the required composer library first:

bash
composer require smsgatewayme/client

:fire: Usage

You can easily send SMS messages in your application code like this:

…

Runtime Configuration

You can override the default gateway configuration at runtime:

php
# Override configuration for this specific SMS
Sms::via('gateway')
    ->config(['from' => 'CUSTOM-SENDER'])
    ->send('this message')
    ->to(['Number1', 'Number2'])
    ->dispatch();

:heart_eyes: Channel Usage

First, you need to create your notification using the php artisan make:notification command. Then, the SmsChannel::class can be used as a notification channel like below:

…

Tip: You can use the same Builder Instance in the send method.

php
$builder = (new Builder)->via('gateway') # via() is Optional
    ->send('this message')
    ->to('some number');

Sms::send($builder);

# OR...
$builder = (new Builder)->send('this message')
    ->to(['some number']);

Sms::via('gateway')->send($builder);

Custom Made Driver, How To:

First, you must define the name of your driver in the drivers array and specify any configuration parameters you need.

php
'drivers' => [
    'textlocal' => [...],
    'twilio' => [...],
    'my_driver' => [
        ... # Your Config Params here.
    ]
]

Next, you need to create a Driver Map Class that will be used to handle sending the SMS. Your driver class simply needs to extend Tzsk\Sms\Contracts\Driver.

For example, if you created a class: App\Packages\SMSDriver\MyDriver.

…

Once you create this class, you must specify it in the sms.php configuration file under the map section.

php
'map' => [
    ...
    'my_driver' => App\Packages\SMSDriver\MyDriver::class,
]

Note:- Ensure that the key of the map array is exactly identical to the key of the drivers array.

:microscope: Testing

bash
composer test

:date: Changelog

Please see CHANGELOG for more information on what has changed recently.

:heart: Contributing

Please see CONTRIBUTING for details.

:lock: Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

:crown: Credits

  • Kazi Ahmed
  • All Contributors

:policeman: License

The MIT License (MIT). Please see License File for more information.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPaws-snsclockworkclockwork-smscomposer

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架