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.
Via Composer
$ composer require nerdbrygg/simplesms
Configure these settings in your .env
SIMPLESMS_SOURCE=
SIMPLESMS_USERNAME=
SIMPLESMS_PASSWORD=
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();
Parameter | Required | Default | Information |
---|---|---|---|
message | Yes | None | 804 characters max |
destination | Yes | None | Separated by ,; |
source | No | SIMPLESMS_SOURCE | Number or text |
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.
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
license. Please see the license file for more information.