PHPackages                             foolkaka/laravel-notification-dayu - 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. foolkaka/laravel-notification-dayu

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

foolkaka/laravel-notification-dayu
==================================

Alibaba Dayu SMS Channel for Laravel 5.3

0.1.2(8y ago)14MITPHPPHP &gt;=5.6.4

Since Jan 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/foolkaka/laravel-notification-dayu)[ Packagist](https://packagist.org/packages/foolkaka/laravel-notification-dayu)[ Docs](https://www.alidayu.com/)[ RSS](/packages/foolkaka-laravel-notification-dayu/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (7)Versions (3)Used By (0)

Alibaba Dayu SMS notifications channel for Laravel 5.4
======================================================

[](#alibaba-dayu-sms-notifications-channel-for-laravel-54)

This package makes it easy to send [Dayu Sms notifications](https://api.alidayu.com/docs/api.htm?spm=a3142.7395905.4.6.KVF6uS&apiId=25450) with Laravel 5.4.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up your Dayu account](#setting-up-your-dayu-account)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require foolkaka/laravel-notification-channel-dayusms
```

You must install the service provider:

```
// config/app.php
'providers' => [
    ...
    NotificationChannels\Dayusms\DayusmsServiceProvider::class,
],
```

### Setting up your Dayu account

[](#setting-up-your-dayu-account)

Add your Dayu Account App Key, App Secret, Sms Template Code (optional), Sign Name as sms\_from(optional) to your `config/services.php`:

```
// config/services.php
...
'dayu' => [
    'app_key' => env('DAYU_APP_KEY'),
    'app_secret' => env('DAYU_APP_SECRET'),
    'format' => 'json',
    'log_dir' => '/tmp',
    'sms_from' => env('DAYU_SMS_SIGN_NAME'),
    'sms_type' => 'normal',
    'sms_template' => env('DAYU_SMS_TEMPLATE','SMS_9655108')
],
...
```

Usage
-----

[](#usage)

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

```
use NotificationChannels\Dayusms\DayusmsChannel;
use NotificationChannels\Dayusms\DayusmsMessage;
use Illuminate\Notifications\Notification;

class ValentineDateApproved extends Notification
{
    public function via($notifiable)
    {
        return [DayusmsChannel::class];
    }

    public function toDayusms($notifiable)
    {
        return (new DayusmsMessage())
            ->content('{"level":"P0", "service":"'.$notifiable->service.'", "info":"502"}');
    }
}
```

In order to let your Notification know which phone number you are sending to, add the `routeNotificationForDayusms` method to your Notifiable model e.g your User Model

```
public function routeNotificationForDayusms()
{
    // where `phone` is a field in your users table;
    // can set multiple phones as string which separated by comma `,` .
    return $this->phone;
}
```

### Available Message methods

[](#available-message-methods)

#### SmsMessage

[](#smsmessage)

- `from('')`: Accepts a sign name to use as the notification sender.
- `content('')`: Accepts a json string value for the notification body.
- `content([])`: Accepts a array value for the notification body.
- `type('')`: Accepts a string value for sms type.
- `template('')`: Accepts a string value for sms template.
- `extend('')`: Accepts a string value for sms callback using.

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% 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 ~268 days

Total

2

Last Release

3129d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f72326c1ee615c5709396e468754e7cf94ae05b670c816c080f4d50c7675bd5?d=identicon)[foolkaka](/maintainers/foolkaka)

---

Top Contributors

[![foolkaka](https://avatars.githubusercontent.com/u/12692799?v=4)](https://github.com/foolkaka "foolkaka (5 commits)")[![hmfuxingwang](https://avatars.githubusercontent.com/u/12264163?v=4)](https://github.com/hmfuxingwang "hmfuxingwang (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/foolkaka-laravel-notification-dayu/health.svg)

```
[![Health](https://phpackages.com/badges/foolkaka-laravel-notification-dayu/health.svg)](https://phpackages.com/packages/foolkaka-laravel-notification-dayu)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

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

Web Push Notifications driver for Laravel.

7984.5M16](/packages/laravel-notification-channels-webpush)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

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

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)

PHPackages © 2026

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