cyaoz94/sms123

A simple package to simplify API integration with SMS Provider SMS123 for Laravel 8

1.0.4 2021-08-27 09:52 UTC

This package is auto-updated.

Last update: 2024-10-27 16:39:17 UTC


README

Latest Version on Packagist Build Status Quality Score Total Downloads

A simple package to simplify API integration with SMS Provider SMS123 for Laravel 8

Installation

You can install the package via composer:

composer require cyaoz94/sms123

Configs

This is not required by default, the package will retrieve the API key and email defined in your .env file using the key SMS123_API_KEY and SMS123_EMAIL. However, you can publish and modify the config file to your liking.

php artisan vendor:publish --provider="Cyaoz94\Sms123\Sms123ServiceProvider" --tag="config"

Usage

This package provides the facade named Sms123Facade. It contains 3 methods with examples below

Sms123Facade::sendSms($contactNumber, $messageContent, $referenceId); // send sms
Sms123Facade::addTemplate($templateTitle, $messageContent, $referenceId); // add template
Sms123Facade::getBalance(); // get balance 

Error Handling

This package provides 2 exception classes

CredentialsException; // when credentials are missing
SmsApiException; // something went wrong when calling sms123 API

Logging

When debug mode is on. This package will log every API call into ../storage/logs/sms123.log

Testing

For now, there are no tests included in this package.

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email casperyaoz@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.