PHP code example of hadhiya / msgowl

1. Go to this page and download the library: Download hadhiya/msgowl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hadhiya / msgowl example snippets


use Hadhiya\MsgOwl\Facades\MsgOwl;
use Hadhiya\MsgOwl\MsgOwlMessage;

// Using the Fluent Builder (Recommended)
MsgOwl::send(
    MsgOwlMessage::create("Your Hadhiya points have been updated!")
        ->to('9601234567')
        ->sender('HADHIYA')
);

// Quick send using an array
MsgOwl::send([
    'recipients' => '9601234567',
    'body' => 'Welcome to Hadhiya!',
]);


// Send an OTP (defaults to 6 digits if not specified)
$response = MsgOwl::sendOtp('9601234567');

// Verify a code provided by the user
$status = MsgOwl::verifyOtp('9601234567', '123456');

if ($status->json('status')) {
    // Identity confirmed!
}


namespace App\Notifications;

use Hadhiya\MsgOwl\Channels\MsgOwlChannel;
use Hadhiya\MsgOwl\MsgOwlMessage;
use Illuminate\Notifications\Notification;

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

    public function toMsgOwl($notifiable)
    {
        return MsgOwlMessage::create("You have received 100 HRF!")
            ->sender('HADHIYA');
    }
}


MsgOwl::send(
    MsgOwlMessage::create("Testing Hadhiya integration...")
        ->to('9601234567')
        ->dryRun()
);

bash
php artisan vendor:publish --tag="msgowl-config"