icekristal/smsint-for-laravel

Laravel 的 SMSINT API

v2.0.0 2024-03-07 08:27 UTC

This package is auto-updated.

Last update: 2024-09-07 09:30:32 UTC


README

集成服务 smsint for Laravel

文档: https://lcab.smsint.ru/cabinet/json-doc/sender

安装

composer require icekristal/smsint-for-laravel

添加到 config/services.php

 'smsint' => [
    'token' => env('SMSINT_TOKEN'),
    'url' => env('SMSINT_URL', "https://lcab.smsint.ru/json/"),
    'version' => env('SMSINT_API_VERSION', "v1.0"),
],

发布配置

php artisan vendor:publish --provider="Icekristal\SmsintForLaravel\SmsintServiceProvider" --tag='config'

发布迁移

php artisan vendor:publish --provider="Icekristal\SmsintForLaravel\SmsintServiceProvider" --tag='migrations'

使用

php artisan migrate

使用 SMS

use Icekristal\SmsintForLaravel\Facades\Smsint;

$phone = ["+79007778899", "+37008009900"];
$textMessage = "Test message integration for service smsint";
$service = Smsint::setRecipients($phone);
$service->setSenderName("SenderName");
$service->setMessage($textMessage);
$service->setIsOnlyValid(true); //true - no send, only check.
$service->setParams([$params]); //set no required params in documentation
$service->sendSms();

$infoStatus = Smsint::getSmsStatus(["2", "3"]);