rongself/laravel-luosimao-sms 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

rongself/laravel-luosimao-sms

Composer 安装命令:

composer require rongself/laravel-luosimao-sms

包简介

luosimao Api for laravel 5.4.*

README 文档

README

螺丝帽 短信 Channel for laravel 5.4.*

安装

composer require 'rongself/laravel-luosimao-sms'

配置

  • 编辑config/app.php注册provider:
'providers' => [
        Rongself\Luosimao\Providers\LuosimaoSmsProvider::class
],
  • 生成配置文件
php artisan vendor:publish 

编辑config/luosimao-sms.php填入app_key

  • 通知模板via中使用Channel
<?php

namespace App\Notifications;

use Illuminate\Notifications\Notification;
use Rongself\Luosimao\Channels\SmsChannel;

/**
 * Class ChargeResult
 * @package App\Notifications
 */
class ChargeResult extends Notification 
{

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [SmsChannel::class];
    }
    
    //定义短信内容
    public function toSmsMessage($notifiable)
    {
        return '验证码:19272【铁壳测试】';
    }
}
  • 自定义电话字段
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;

class User extends Model
{
    use Notifiable;
    
    //添加getPhone方法返回相应字段
    public function getPhone()
    {
        return $this->Tel;
    }

}
  • 发送
<?php
//发送通知消息
$user = User::find(1);
$message = new ChargeResult();
$user->notify($message);

关于通知消息使用详情参考 laravel官方文档

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固