Looking to hire Laravel developers? Try LaraJobs

laravel-smspoh-v3 maintained by myomyintaung512

Last update
2025/02/27 05:20 (dev-main)
Links
Downloads
497

Comments
comments powered by Disqus

Laravel SMSPoh V3 Integration

This package provides an easy way to integrate SMSPoh SMS services into your Laravel application.

Installation

composer require myomyintaung512/laravel-smspoh-v3

Publish the configuration file:

php artisan vendor:publish --provider="myomyintaung512\LaravelSmspoh\SMSPohServiceProvider"

Configuration

Add the following variables to your .env file:

SMSPOH_API_KEY=your_api_key
SMSPOH_API_SECRET=your_api_secret
SMSPOH_SENDER_ID=your_sender_id
SMSPOH_BASE_URL=https://v3.smspoh.com/api/rest

Usage

Basic Usage

use myomyintaung512\LaravelSmspoh\Facades\SMSPoh;

// Send SMS
app()->smspoh->send('1234567890', 'Your message here');

// Check balance
$balance = app()->smspoh->balance();

// Send verification SMS
app()->smspoh->verify('1234567890', 'Your verification code is: 123456');

// Check message status
app()->smspoh->status('message_id');

Using Laravel Notifications

use Illuminate\Notifications\Notification;
use myomyintaung512\LaravelSmspoh\SMSPohChannel;

class VerificationNotification extends Notification
{
    public function via($notifiable)
    {
        return [SMSPohChannel::class];
    }

    public function toSMSPoh($notifiable)
    {
        return [
            'to' => $notifiable->phone,
            'message' => 'Your verification code is: ' . $this->code
        ];
    }
}

License

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