PHP code example of laravel-notification-channels / interfax

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

    

laravel-notification-channels / interfax example snippets


...
'interfax' => [
    'username' => env('INTERFAX_USERNAME'),
    'password' => env('INTERFAX_PASSWORD'),
    'pci'      => env('INTERFAX_PCI', false),
    'interval' => 15,
    'chunk_size' => null,
],
...


use NotificationChannels\Interfax\InterfaxChannel;
use NotificationChannels\Interfax\InterfaxMessage;
use NotificationChannels\Interfax\Contracts\InterfaxNotificationContract;

class DocumentWasSent extends Notification implements InterfaxNotificationContract
{

    protected $files;

    public function __construct(array $files)
    {
        $this->files = $files;
    }

    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [InterfaxChannel::class];
    }

    public function toInterfax($notifiable): InterfaxMessage
    {
        return (new InterfaxMessage)
              ->files($this->files);
    }
}

public function routeNotificationForInterfax($notification)
{
    if($this->fax)
        return preg_replace('/[^\d]/', '', $this->fax);

    return null;
}