PHP code example of edwardkarlsson / laravel-pushover

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

    

edwardkarlsson / laravel-pushover example snippets


$message = new PushoverMessage('My message');
$message->send();

$message = new PushoverMessage('My content', 'My title');
$message->send();

$message = new PushoverMessage('My <b>message</b> content.', 'My title!');
        
$message->isHtml()
    ->sound('cashregister')
    ->url('http://example.com')
    ->urlTitle('ExampleSite')
    ->priority(1)
    ->device('my-main-device')
    ->send();

$limitation = new PushoverLimitation();

$limitsResponse = $limitation->get();

echo $limitsResponse->limit();
echo $limitsResponse->remaining();
echo $limitsResponse->reset();

$message = new PushoverMessage($this->faker->sentence, $this->faker->word);

$messageResponse = $message
    ->priority(2)
    ->retry(30)
    ->expire(120)
    ->send();

$receiptResponse = $messageResponse->receipt()->get();

// Available methods
$receiptResponse->acknowledged(); // returns boolean
$receiptResponse->acknowledgedAt(); // returns Carbon
$receiptResponse->acknowledgedBy(); // returns string
$receiptResponse->acknowledgedByDevice(); // returns string
$receiptResponse->lastDeliveredAt(); // returns Carbon
$receiptResponse->expired(); // returns boolean
$receiptResponse->expiresAt(); // returns Carbon
$receiptResponse->calledBack(); // returns boolean
$receiptResponse->calledBackAt(); // returns Carbon