承接 hebinet/laravel-websms-notification-channel 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hebinet/laravel-websms-notification-channel

最新稳定版本:v1.5.0

Composer 安装命令:

composer require hebinet/laravel-websms-notification-channel

包简介

WebSMS Notification Channel for laravel.

README 文档

README

Provides a Notification Channel for WebSms

Installation

You can install it using Composer:

composer require hebinet/laravel-websms-notification-channel

Then publish the config file of the package.

php artisan vendor:publish --provider="Hebinet\Notifications\WebSmsChannelServiceProvider" --tag=config

Usage

If a notification supports being sent as an SMS, you should define a toWebsms method on the notification class. This method will receive a $notifiable entity and should return a string with the content of the SMS:

/**
 * Get the WebSMS / SMS representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return string
 */
public function toWebsms($notifiable)
{
    return 'Your SMS message content';
}

Routing SMS Notifications

To route Nexmo notifications to the proper phone number, define a routeNotificationForWebsms method on your notifiable entity:

<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * Route notifications for the WebSms channel.
     *
     * @param  \Illuminate\Notifications\Notification  $notification
     * @return string
     */
    public function routeNotificationForWebsms($notification)
    {
        return $this->phone_number;
    }
}

Contributing

Please see CONTRIBUTING for details.

Security

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

License

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

统计信息

  • 总下载量: 854
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-06