PHP code example of godforhire / prowlnotifications

1. Go to this page and download the library: Download godforhire/prowlnotifications 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/ */

    

godforhire / prowlnotifications example snippets


// config/services.php
'prowl' => [
    'token' => env('PROWL_API_KEY'),
]

use godforhire\ProwlNotifications\ProwlChannel;
use godforhire\ProwlNotifications\ProwlMessage;
use Illuminate\Notifications\Notification;

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

    public function toProwl($notifiable)
    {
        return ProwlMessage::create()
                    ->priority(2)
                    ->url('http://your.app');
                    ->application("Your App")
                    ->event("Backup failed")
                    ->description("Daily backup of Your App has failed: reason, disk S3 is unreachable.")
    }
}