承接 toonday/laravel-bulksmsnigeria-notification 相关项目开发

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

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

toonday/laravel-bulksmsnigeria-notification

Composer 安装命令:

composer require toonday/laravel-bulksmsnigeria-notification

包简介

A laravel channel for bulk nigeria sms provider.

README 文档

README

Build Status

This is a laravel package for sending sms (or bulk sms) to local (Nigerian) phone numbers for Laravel >=5.3.*.

Installation is pretty straight forward: use either

composer require toonday/laravel-bulksmsnigeria-notification

or add to your composer.json file:

{
    "require": {
        "toonday/laravel-bulksmsnigeria-notification": "~1.0"
    }
}

if using laravel <=5.3.*, add the provider to your app.php file like so:

"providers" => [
    ...
    "Toonday\BulkSMSNigeria\BulkSMSNigeriaServiceProvider",
    ...
]

Please do not forget to publish the config file with the artisan command like so:

php artisan vendor:publish --provider="Toonday\BulkSMSNigeria\BulkSMSNigeriaServiceProvider" --tag=config

and you're all good to go.

If you haven't, please proceed to the bulksmsnigeria to register and get your api token. Then include in your .env file the following:

BULKSMSNIGERIA_FROM=token

The package works just like your typical laravel built in notification package. Just add the notifiable trait to the model using the notification (typically the User model) as highlighted here. Further, you should add this method to the same model so the package can know which property of the model to target:

public function routeNotificationForBulkSMSNigeria($notification)
{
    return $user->phone_number;
}

In your notification class, add the following lines:

...
use Toonday\BulkSMSNigeria\BulkSMSNigeriaChannel;
...

public function via($notifiable)
{
    return [BulkSMSNigeriaChannel::class];
}

To compose your message, you can follow the example below:

...
use Toonday\BulkSMSNigeria\BulkSMSMessage;
...

public function toBulkSmsNigeria($notifiable)
{
    return (new BulkSMSMessage)
                ->body('This a test message');
}

The BulkSMSMessage class provides the following methods for you:

Methods Usage
body Content of the message
from If not specified in the .env file, this method will set the from parameter. In the case where it has already been set, it'll take precedence and reset the parameter.

With all that in place you can proceed to sending your text messages.

Happy coding.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固