承接 cuneytyuksel/toplusms 相关项目开发

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

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

cuneytyuksel/toplusms

Composer 安装命令:

composer require cuneytyuksel/toplusms

包简介

Laravel Notification for toplusmsapi.com

README 文档

README

Introduction

This is a simple Notifications channel for Laravel.

Installation

First, you'll need to require the package with Composer:

composer require cuneytyuksel/toplusms

Aftwards, run composer update from your command line.

Then, update config/app.php by adding an entry for the service provider.

'providers' => [
	// ...
    Sms\TopluSms\TopluSmsProvider::class,
];

Then, update config/services.php by adding your toplusms credentials.

return [
   // ...
	,
        'toplusms' => [
            'username' => env('TOPLUSMS_USERNAME'),
            'password' => env('TOPLUSMS_PASSWORD'),
            'from' => env('TOPLUSMS_FROM', null), // Can be ovverdiden with $message->from() 
        ]
    // ...
];

Usage

Routing sms notifications

In order to send sms messages, you need to specify recipient for each notifiable entity. For instance in app/user.php

    // ...
    public function routeNotificationForSms(){
        return $this->phone;
    }
    // ...

Sending notification

via Method

In your notification class you can define channel as:

    // ...
    public function via($notifiable)
    {
        return ['sms'];
    }
    // ...

toSMS Method

You also need to define, toSms method. You can:

  1. Send a simple string as:
    // ...
    public function toSms($notifiable)
    {
        return "Hello World!";
    }
    // ...
  1. Or define a from (sender) to override config:
    // ...
    public function toSms($notifiable)
    {
       $message = new SmsMessage("Hello World");
       $message->from("5xxxxxxxxx");
       return $message;
    }
    // ...

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固