ahmedrafat/magic-sms

Magic SMS allows you to send SMS from your Laravel application with any sms gateway.

1.0.0 2021-01-29 20:21 UTC

This package is auto-updated.

Last update: 2024-04-04 17:42:19 UTC


README

Magic SMS allows you to send SMS from your Laravel application with any sms gateway.

Requirements

  • Laravel >=5.6

Installation

You can install the package via composer:

composer require ahmedrafat/magic-sms

Publishing files

Run the following Command to create config ( config/magic-sms.php ) file. You can set your sms details in the config file.

php artisan vendor:publish --provider="AR\\MagicSms\\Providers\\MagicSmsServiceProvider"

Usage

//using MagicSMS
use AR\MagicSms\MagicSms;

$sms = (new MagicSms)->send($destination, $message);
// You can check if send success via $sms->successful()
// Or can check if send failed via $sms->failed()
// or get the server response via $sms->getResponse()

Using Helper function

$sendSms = magicSendSms($destination, $message); //returns true/false

[ Headers, Request, Response] will be logged in storage/logs/magic-sms
note: you can enable/disable log from config file