Skip to content

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