PHP code example of xcoorp / laravel-novu-notifications

1. Go to this page and download the library: Download xcoorp/laravel-novu-notifications 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/ */

    

xcoorp / laravel-novu-notifications example snippets


class InvoicePaidNotification extends Notification
{
    // Trigger a specific notification event
    public function toNovuEvent($notifiable)
    {
        return NovuMessage::create('workflow_1234')
            ->addVariable('invoice_id', $this->invoice->id)
            ->toSubscriberId('123456789');
    }
}

use NotificationChannels\Novu\NovuChannel;

public function via($notifiable)
{
    return [
        NovuChannel::class
    ]
}