overtrue/laravel-easy-sms

overtrue/easy-sms service provider for Laravel.
4,730 30
Install
composer require overtrue/laravel-easy-sms
Latest Version:v4.0.0
PHP:^8.3
Laravel:13
Older releases:6 – 12
License:MIT
Last Updated:Oct 4, 2026
Links: GitHub  ·  Packagist
Maintainer: overtrue

Laravel EasySMS

overtrue/easy-sms service provider for Laravel.

Laravel Octane Ready Status GitHub release (latest SemVer) GitHub License Packagist Downloads

Sponsor me

Installing

$ composer require overtrue/laravel-easy-sms

Usage

config/services.php

    'easy-sms' => [
        // HTTP 请求的超时时间(秒)
        'timeout' => 5.0,

        // 默认发送配置
        'default' => [
            // 网关调用策略,默认:顺序调用
            'strategy' => \Overtrue\EasySms\Strategies\OrderStrategy::class,

            // 默认可用的发送网关
            'gateways' => [
                'yunpian', 'aliyun',
            ],
        ],
        // 可用的网关配置
        'gateways' => [
            'errorlog' => [
                'file' => '/tmp/easy-sms.log',
            ],
            'yunpian' => [
                'api_key' => env('EASY_SMS_YUNPIAN_API_KEY'),
            ],
            'aliyun' => [
                'access_key_id' => env('EASY_SMS_ALIYUN_KEY_ID'),
                'access_key_secret' =>  env('EASY_SMS_ALIYUN_API_KEY'),
                'sign_name' => '',
            ],
            //...
        ],
    ],

Send a message:

app('easy-sms')->send(13188888888, [
    'content'  => '您的验证码为: 6379',
    'template' => 'SMS_001',
    'data' => [
        'code' => 6379
    ],
]);

More...

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

Sponsor me

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

License

MIT

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

593,882,149 34,959
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

399,241,428 4,660

Version History

Version Released PHP Laravel License
v4.0.0 ^8.3 ^13.0 MIT
3.0.0 ^10.0|^11.0|^12.0 MIT
2.3.0 ^9.0|^10.0|^11.0|^12.0 MIT
2.2.0 ^9.0|^10.0|^11.0 MIT
2.1.0 ^9.0|^10.0 MIT