PHP code example of fixedbit / laravel-pushover

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

    

fixedbit / laravel-pushover example snippets


// (REQUIRED) Import our PushoverMessage package
use Pushover\PushoverMessage;

// 1) Simple with just message
$message = new PushoverMessage('Taylor Otwell is a Legend')->send();

// 2) Simple with message and title
$message = new PushoverMessage('Learn Laravel from laracasts.com!', 'Learn Laravel')->send();

// 3) You can also choose to add a message (and/or) title as part of the chain
$message = new PushoverMessage()->message('Futurama Forever!')->title('Best TV Show')->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