PHP code example of msonowal / laravel-notification-channel-textlocal

1. Go to this page and download the library: Download msonowal/laravel-notification-channel-textlocal 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/ */

    

msonowal / laravel-notification-channel-textlocal example snippets


use Illuminate\Notifications\Notification;
use NotificationChannels\Textlocal\TextlocalChannel;

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

    public function toSms($notifiable)
    {
        return 'Use 1234 as OTP for resetting your password.';
    }
}

public function routeNotificationForTextlocal(): array
{
    return [$this->mobile_no];
}

Notification::route('Textlocal', $mobileNo')->notify(new VerifyMobileNotification($otp));