PHP code example of diviky / laravel-notification-channel-vfirst

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

    

diviky / laravel-notification-channel-vfirst example snippets


// config/services.php
...
'vfirst' => [
    'username' => env('VFIRST_USERNAME'), // optional when using auth token
    'password' => env('VFIRST_PASSWORD'), // optional when using auth token
    'from' => env('VFIRST_FROM'), // optional
],
...

public function routeNotificationForMobtexting()
{
    return '+1234567890';
}
 php
use NotificationChannels\Vfirst\SmsChannel;
use NotificationChannels\Vfirst\Message;
use Illuminate\Notifications\Notification;

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

    public function toVfirst($notifiable)
    {
        return (new Message())
            ->text("Your {$notifiable->service} account was approved!");
    }
}