Skip to content
/ sms Public

This is laravel library to sending SMS and verification system with SMS.

License

Notifications You must be signed in to change notification settings

puzzley/sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Laravel SMS Package 📲

A Laravel package for sending SMS using PayamResan, KaveNegar, and FarazSMS drivers.

Requirements ⚙️

  • PHP: >=7.2
  • Laravel: ^8.0, ^9.0, ^10.0

Installation 🛠️

Install the package via Composer:

composer require puzzley/sms

Configuration ⚙️

  1. Publish the Configuration File: Run the following command to publish the sms.php config file:

    php artisan vendor:publish --tag=sms-config
  2. Add Environment Variables: Update your .env file with the necessary credentials:

    DEFAULT_SMS_SERVICE=KaveNegar
    
    PAYAMRESAN_USERNAME=your-username
    PAYAMRESAN_PASSWORD=your-password
    PAYAMRESAN_SERVICE_NUMBER_DEFAULT=XXXX
    
    KAVENEGAR_API_KEY=your-api-key
    KAVENEGAR_SERVICE_NUMBER_DEFAULT=90004803
    
    FARAZSMS_USERNAME=your-username
    FARAZSMS_PASSWORD=your-password
    FARAZSMS_SERVICE_NUMBER_DEFAULT=+983000505
  3. Set Default Service: The default SMS service can be set in your .env file using DEFAULT_SMS_SERVICE.


Usage 🚀

The package provides a unified interface for interacting with different SMS services:

use SMS;

// Sending an SMS
$smsId = SMS::send('09123456789', 'Your message here');

// Using a specific driver
$smsId = SMS::driver('FarazSMS')->send('09123456789', 'Your message here');

// Check Status
$status = SMS::driver('PayamResan')->status($smsId);

// Send Verification Code
SMS::driver('KaveNegar')->sendVerifyCode('09123456789', 'Verification message');

Credits 👏

  • Mohammad Zare Moghadam
  • Amir Reza Rezaei

License 📜

This package is open-sourced software licensed under the MIT License.

About

This is laravel library to sending SMS and verification system with SMS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages