icekristal/smsint-for-laravel

SMSINT API for Laravel

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

This package is auto-updated.

Last update: 2024-11-07 09:51:26 UTC


README

Integration service smsint for laravel

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

install:

composer require icekristal/smsint-for-laravel

Add to config/services.php

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

Publish config:

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

Publish migrations:

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

Use:

php artisan migrate

Use 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"]);