# InterFAX notification channel for Laravel 6.x, 7.x and 8.x

Latest Version on Packagist Software License Build Status StyleCI Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using InterFAX with Laravel 6.x and above.

# Contents

# Installation

You can install this package via composer:

composer require laravel-notification-channels/interfax

The service provider gets loaded automatically.

# Setting up the InterFAX service

This channel will use your InterFAX username and password. To use the channel, add this to your config/services.php file:

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

This will load your InterFAX credentials from the .env file. If your requests must be PCI-DSS-compliant, set INTERFAX_PCI=true in your .env file.

The services.interfax.interval setting is the polling interval, in seconds, for a fax if it is set to check the status until it is complete. This is optional and will default to 15 if left empty. The interval has a minimum of 10 seconds, as the outbound service in the API has a maximum freqncy of 6 requests per minute and can return errors if polled more frequently.

# Usage

To use this package, you can create a notification class, like DocumentWasSent from the example below, in your Laravel application. Make sure to check out Laravel's documentation for this process.

# Send PDF via fax

use NotificationChannels\Interfax\InterfaxChannel;
use NotificationChannels\Interfax\InterfaxMessage;

class DocumentWasSent extends Notification

    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)
        return (new InterfaxMessage)

The Notifiable model will need to return a destination fax number.

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

    return null;

# Available Message methods

file(string $file) : Accepts the full path to a single file (full list of supported file types found here).
files(array $array) : Accepts an array of file paths.
stream(Filestream $stream, string $name) : Accepts a file stream.

# Changelog

Please see CHANGELOG for more information what has changed recently.

# Testing

$ composer test

# Security

If you discover any security related issues, please email craig.spivack@ivinteractive.com instead of using the issue tracker.

# Contributing

Please see CONTRIBUTING for details.

# Credits

# License

The MIT License (MIT). Please see License File for more information.