PHP code example of coreproc / laravel-notification-channel-telerivet

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

    

coreproc / laravel-notification-channel-telerivet example snippets


use CoreProc\NotificationChannels\Telerivet\TelerivetChannel;
use CoreProc\NotificationChannels\Telerivet\TelerivetMessage;
use Illuminate\Notifications\Notification;

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

    public function toTelerivet($notifiable)
    {
        return (new TelerivetMessage())
            ->setContent('Hello this is a test message');
    }
}

class User extends Authenticatable
{
    use Notifiable;

    ....

    /**
     * Specifies the user's mobile number for use in Telerivet
     *
     * @return string
     */
    public function routeNotificationForTelerivet()
    {
        return $this->mobile_number;
    }
}

setMessageType(?string $messageType)

setContent(?string $content)

setToNumber(?string $toNumber)

setContactId(?string $contactId)

setRouteId(?string $routeId)

setStatusUrl(?string $statusUrl)

setStatusSecret(?string $statusSecret)

setIsTemplate(?bool $isTemplate)

setTrackClicks(?bool $trackClicks)

setMediaUrls(?array $mediaUrls)

setLabelIds(?array $labelIds)

setVars(?object $vars)

setPriority(?int $priority)

setSimulated(?bool $simulated)

setServiceId(?string $serviceId)

setAudioUrl(?string $audioUrl)

setTtsLang(?string $ttsLang)

setTtsVoice(?string $ttsVoice)

php artisan vendor:publish --provider="CoreProc\NotificationChannels\Telerivet\TelerivetServiceProvider"

php artisan vendor:publish --provider="CoreProc\NotificationChannels\Telerivet\TelerivetServiceProvider"