intoegy/sms

Send GSM Short Message (SMS) from your laravel application

1.0.5 2022-01-07 13:01 UTC

This package is auto-updated.

Last update: 2025-03-07 19:53:16 UTC


README

Send GSM Short Message (SMS) from your laravel application

Build Status Software License Total Downloads

Implements https://github.com/intoegy/sms for Laravel

About

The intoegy/sms package allows you to send SMS from your laravel application.

Installation

Require the intoegy/sms package in your composer.json and update your dependencies:

composer require intoegy/sms

If you get a conflict, this could be because an older version of intoegy/sms or intoegy/sms is installed. Remove the conflicting package first, then try install again:

composer remove intoegy/sms 
composer require intoegy/sms

Configuration

In the first you have to create account at SMS Egypt.

The defaults are set in config/sms.php. Publish the config to copy the file to your own config:

php artisan vendor:publish --tag="sms-config"

If you get error in previuse step you have to create the configuration file called /config/sms.php contains this content:

<?php

return [
    
    'username'      =>    env('SMS_USER','<username>'),
    'password'      =>    env('SMS_PASS','<password>'),
    'sender'        =>    env('SMS_SENDER','<your-approved-sender>),
     
    ];

And for more security you can add this information in .env file:

#...
SMS_USER    = 
SMS_PASS    =
SMS_SENDER  =
#...

You have to add the package provider to your app providers list:

'providers' => [
   // ...
   Intoegy\SMS\SMSServcieProvider::class,
   // ...
]

Global usage

    SMS::send('201010000000','test message');

To you can send sms from any place in you project, add the SMS aliase in application's aliases at config/app.php:

'aliases' => [

    "SMS"=>Intoegy\SMS\SMSServiceProvider::class,
    // ...
];

License

Released under the MIT License, see LICENSE.