PHPackages                             friendsofhyperf/notification-easysms - 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. friendsofhyperf/notification-easysms

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

friendsofhyperf/notification-easysms
====================================

The EasySms Channel for friendsofhyperf/notification.

v3.2.1(3w ago)02.0k↑56.3%MITPHP

Since Jun 1Pushed 3w ago2 watchersCompare

[ Source](https://github.com/friendsofhyperf/notification-easysms)[ Packagist](https://packagist.org/packages/friendsofhyperf/notification-easysms)[ Fund](https://hdj.me/sponsors/)[ GitHub Sponsors](https://github.com/huangdijia)[ RSS](/packages/friendsofhyperf-notification-easysms/feed)WikiDiscussions main Synced today

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

Notification EasySms Channel
============================

[](#notification-easysms-channel)

[中文说明](README_CN.md)

This component sends notifications through [EasySms](https://github.com/overtrue/easy-sms).

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

[](#installation)

```
composer require friendsofhyperf/notification-easysms
```

The component requires `friendsofhyperf/notification` and `overtrue/easy-sms:^3.0`; Composer installs them automatically.

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

[](#configuration)

Publish `config/autoload/easy_sms.php`, then configure its default strategy, default gateways, and gateway credentials according to the EasySms documentation:

```
php bin/hyperf.php vendor:publish friendsofhyperf/notification-easysms
```

The component constructs its `EasySms` instance from the complete `easy_sms` configuration array.

Usage
-----

[](#usage)

When the application boots, the component registers `EasySmsChannel` under the `easy-sms`channel name.

### Define the Notification Route

[](#define-the-notification-route)

Use the `Notifiable` trait on the recipient and define `routeNotificationForSms()`. Return the phone number as a string.

```
