PHP code example of wijourdil / ntfy-notification-channel

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

    

wijourdil / ntfy-notification-channel example snippets


use Wijourdil\NtfyNotificationChannel\Channels\NtfyChannel;

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

use Ntfy\Message;

public function toNtfy(mixed $notifiable): Message
{
    $message = new Message();
    $message->topic('test');
    $message->title('It works!');
    $message->body("And voila, I sent my notification using ntfy.sh!");
    $message->tags(['white_check_mark', 'ok_hand']);

    return $message;
}
bash
php artisan vendor:publish --tag="ntfy-notification-channel-config"