atomjoy/smsapisms 问题修复 & 功能扩展

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

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

atomjoy/smsapisms

最新稳定版本:v1.3

Composer 安装命令:

composer require atomjoy/smsapisms

包简介

Smsapi Laravel SMS notifications.

README 文档

README

Laravel SMS Notifications allows you to send SMS from your Laravel application.

Install

composer require "atomjoy/smsapisms"

Config

config/smsapisms.php

php artisan vendor:publish --tag=smsapisms-config --force

Service

return [
    'api_service' => 'pl', // Default smsapi.pl service. Options: [ pl, com, se, bg ]
    'api_token' => 'EMPTY_API_TOKEN', // Api bearer token
    'api_from' => 'Test', // Default sms sender name
    'api_encoding' => 'utf-8',  // Default charset
    'api_details' => true,  // More response details
    'api_test' => false,  // Test mode
];

Routes

routes/web.php

<?php

use App\Models\User;
use Atomjoy\Sms\Notifications\SendSms;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Route;

// Smsapi sms
Route::get('/sms', function () {
    try {
        $user = User::first();

        // Send smss
        $user->notify(
            new SendSms(
                'New Order [%idzdo:smsapi.pl/panel%]',
                ['48100100100', '44200200200']
            )
        );

        // Or with
        Notification::sendNow(
            $user,
            new SendSms(
                'New Order [%idzdo:smsapi.pl/panel%]',
                ['48100100100', '44200200200']
            )
        );
    } catch (\Exception $e) {
        return $e->getMessage();
    }

    return 'Message has been send.';
});

Server

php artisan serve --host=localhost --port=8000

Events

<?php

use Atomjoy\Sms\Events\SmsSent;
use Atomjoy\Sms\Events\SmsSentError;

// ...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-17