webiver/laravel-twilio 问题修复 & 功能扩展

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

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

webiver/laravel-twilio

Composer 安装命令:

composer require webiver/laravel-twilio

包简介

This is a Laravel package for Twilio

README 文档

README

A laravel package that helps you integrate twilio into your laravel app easily.

Installation

Require the package in the composer file:

    "require": {
        ....
        "webiver/laravel-twilio": "dev-master"
    },

then run composer install.

Register the provider

Register the package service provider in config/app.php file:

Webiver\LaravelTwilio\LaravelTwilioServiceProvider::class,

Add Environment Variables

Now we have to add three lines in .env file

TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_SMS_PHONE_NUMBER=
TWILIO_WHATSAPP_PHONE_NUMBER=

TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN are credentails that you can get from your twilio account.

TWILIO_SMS_PHONE_NUMBER refers to the sms phone sender number that will be registered with twillio.

TWILIO_WHATSAPP_PHONE_NUMBER refers to the whatsapp phone sender number that will be registered with twillio.

add these values and run:

php artisan config:clear

Usage

use Webiver\LaravelTwilio\Twilio;



$toPhone = "+20120****"; // You need to complete the number in the international format
$mesaage = "Hello World";

// send sms message
Twilio::sms($toPhone,$mesaage);

// send whatsapp message
Twilio::whatsapp($toPhone,$mesaage);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-04