tuanx/laravel-smpp

There is no license information available for the latest version (1.0.0) of this package.

SMS sending via SMPP protocol for Laravel framework.

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 32

pkg:composer/tuanx/laravel-smpp

1.0.0 2024-07-10 09:46 UTC

This package is auto-updated.

Last update: 2025-12-11 11:18:57 UTC


README

Laravel SMPP

This package is a tiny wrapper for the onlinecity/php-smpp library. It provides a basic SMPP interface and implementation for the Laravel framework.

Installation

You can install Laravel SMPP using Composer command:

$ composer require tuanx/laravel-smpp

Then you need to add LaravelSmpp\LaravelSmppServiceProvider::class to your providers array in the config/app.php and copy default configuration by invoking $ php artisan vendor:publish command.

Usage

You can use the service pretty straightforward and inject dependency in your controller:

<?php

namespace App\Http\Controllers;

class SmsController extends Controller
{
    public function send(SmppServiceInterface $smpp)
    {
        // One number
        $this->smpp->sendOne(1234567890, 'Hi, this SMS was send via SMPP protocol');
        
        // Multiple numbers
        $this->smpp->sendBulk([1234567890, 0987654321], 'Hi!');
    }
}

However it is better to abstract your SMS sending service from the SMPP implementation by defining a SMPP-compatible service interface.