This package makes it easy to send notifications using InterFAX with Laravel 5.8+ and 6.0
You can install this package via composer:
composer require laravel-notification-channels/interfax
The service provider gets loaded automatically.
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),
],
...
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.
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.
<?php
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)
->files($this->files);
}
}
The Notifiable model will need to return a destination fax number.
public function routeNotificationForInterfax($notification)
{
if($this->fax)
return preg_replace('/[^\d]/', '', $this->fax);
return null;
}
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.
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email craig.spivack@ivinteractive.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.