nerdbrygg/simplesms

Integrates PSWinCom's Simple SMS API with Laravel.

0.3.0 2021-01-22 08:26 UTC

This package is auto-updated.

Last update: 2024-10-29 06:00:05 UTC


README

Latest Version on Packagist Total Downloads Tests StyleCI

My first Laravel Package, uses Laravel's Http client to interact with PSWin.com's Simple HTTP API.

It offers the option to store messages in a database table, and also ability to encrypt/decrypt the message, for added security.

Installation

Via Composer

$ composer require nerdbrygg/simplesms

Configure these settings in your .env

SIMPLESMS_SOURCE=
SIMPLESMS_USERNAME=
SIMPLESMS_PASSWORD=

Usage

By default the only middleware applied to the route is web. To secure this, you'd need to overwrite the route:

Route::middleware(['auth'])->group(function () {
    Route::post('sms/send', ['\Nerdbrygg\SimpleSMS\Controllers\SmsController', 'store'])->name('sms.store');
});
SimpleSMS::create(['message' => 'Hello World!', 'destination' => 'numbers [delimiters: ,;|.]', 'source' => 'Optional'])->send();

Parameters

Components

I've created a couple of simple bootstrap-themed components to get you up and running faster.

Form

<x-simplesms-form title="Some Title (optional)" :source="true (default: true)"></x-simplesms-form>

Will render a basic form for sending an sms.

Use :source="false" to stop source-field from rendering.

Messages

<x-simplesms-messages title="Some Title (optional)"></x-simplesms-messages>

Will render a basic display of all sent messages.

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.