PHP code example of skrypnik-dzencode / sendpulse-laravel

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

    

skrypnik-dzencode / sendpulse-laravel example snippets


$message = ['title' => 'My first notification', 'website_id' => 1, 'body' => 'I am the body of the push message'];

SendPulse::createPushTask($message);

    # Add `SendPulseLaravelServiceProvider` to the `providers` array
    'providers' => array(
        ...
        'SendPulse\SendPulseLaravel\SendPulseLaravelServiceProvider',
    )

    # Add the `SendPushFacade` to the `aliases` array
    'aliases' => array(
        ...
        'SendPulse' => 'SendPulse\SendPulseLaravel\SendPulseFacade',
    )
    

use SendPulse\SendpulseApi;

private $client;

public function __construct(SendpulseApi $client)
{
    $this->client = $client;
}

public function getWebsites()
{
	$this->client->pushListWebsites();
}
shell
    $ php artisan vendor:publish