laravel-notification-channels / pushbullet

Licence: MIT license
Pushbullet notifications channel for Laravel

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to pushbullet

laravel-sms-api
Laravel package to provide SMS API integration.
Stars: ✭ 84 (+500%)
Mutual labels:  laravel-package, laravel-notifications
laravel-snowflake
This Laravel package to generate 64 bit identifier like the snowflake within Twitter.
Stars: ✭ 94 (+571.43%)
Mutual labels:  laravel-package
PFMonitor
PFMonitor -- for deep learning engineer's freedom
Stars: ✭ 17 (+21.43%)
Mutual labels:  pushbullet
voyager-portfolio
A Portfolio Module for Laravel Voyager 💋
Stars: ✭ 15 (+7.14%)
Mutual labels:  laravel-package
meituan-pub-union
🌈 美团分销联盟 PHP-SDK
Stars: ✭ 19 (+35.71%)
Mutual labels:  laravel-package
laravel-smart-facades
Strategy design pattern in laravel, the easiest way.
Stars: ✭ 84 (+500%)
Mutual labels:  laravel-package
laravel-spotify
Laravel-Spotify is a simple wrapper around the Spotify Web API that makes working with its endpoints a breeze!
Stars: ✭ 141 (+907.14%)
Mutual labels:  laravel-package
laravel-charts-css
Laravel component to create gorgeous Charts.css charts.
Stars: ✭ 105 (+650%)
Mutual labels:  laravel-package
laravel route summary
Create a summary of all the laravel routes
Stars: ✭ 11 (-21.43%)
Mutual labels:  laravel-package
simple-recaptcha-v3
🤖 This repository contains simple reCAPTCHA v3 integration for your Laravel application.
Stars: ✭ 25 (+78.57%)
Mutual labels:  laravel-package
laracash
PHP Laravel Money Package 💰
Stars: ✭ 52 (+271.43%)
Mutual labels:  laravel-package
aliyun-oss-laravel
Laravel 的 Aliyun OSS 扩展, 支持 Laravel 9. Alibaba Cloud Object Storage Service For Laravel.
Stars: ✭ 91 (+550%)
Mutual labels:  laravel-package
voyager-page-blocks
A module to provide page blocks for Voyager 📝
Stars: ✭ 80 (+471.43%)
Mutual labels:  laravel-package
laravel-coming-soon
Laravel package to display Coming Soon page
Stars: ✭ 19 (+35.71%)
Mutual labels:  laravel-package
laravel-ab
Laravel A/B experiment testing tool
Stars: ✭ 108 (+671.43%)
Mutual labels:  laravel-package
laravel-secureheaders
🔒 SecureHeaders wrapper for Laravel.
Stars: ✭ 52 (+271.43%)
Mutual labels:  laravel-package
firebase-php
Firebase Realtime Database PHP Wrapper
Stars: ✭ 41 (+192.86%)
Mutual labels:  laravel-package
laravel-helper-functions
Laravel-specific and pure PHP Helper Functions.
Stars: ✭ 106 (+657.14%)
Mutual labels:  laravel-package
laravel-dadata
PHP SDK Laravel пакет работы с сервисом DaData.ru, для исправления синтаксических ошибок в информации контактных данных клиентов сайта и вывода подсказок поля форм.
Stars: ✭ 39 (+178.57%)
Mutual labels:  laravel-package
lastfm
🎶 Last.fm API client for PHP. Comes with a Laravel service provider.
Stars: ✭ 17 (+21.43%)
Mutual labels:  laravel-package

Pushbullet notification channel for Laravel

Latest Version on Packagist Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using Pushbullet with Laravel 5.5+, 6.x, 7.x and 8.x.

Contents

Installation

To get the latest version of Pushbullet Notification channel for Laravel 5.3, simply require the project using Composer:

$ composer require laravel-notification-channels/pushbullet

Or you can manually update your require block and run composer update if you choose so:

{
    "require": {
        "laravel-notification-channels/pushbullet": "^1.0"
    }
}

Setting up the Pushbullet service

In your pushbullet account go to Account settings page. Click Create Access Token button and you will get access_token.

You need to put it to config/services.php configuration file. You may copy the example configuration below to get started:

'pushbullet' => [
    'access_token' => env('PUSHBULLET_ACCESS_TOKEN')
]

Usage

Routing Pushbullet notifications

In order to send notifications to Pushbullet you need to specify recipient for each notifiable entity. There are currently 2 options: pushbullet email or device id of recipient. To provide library with correct notification recipient you need to define routeNotificationForPushbullet method on notifiable entity.

Sending notification to email:

public function routeNotificationForPushbullet()
{
    return new \NotificationChannels\Pushbullet\Targets\Email($this->email);
}

Sending notification to device id:

public function routeNotificationForPushbullet()
{
    return new \NotificationChannels\Pushbullet\Targets\Device($this->pushbullet_device_id);
}

Sending notification to all subscribers of channel that has tag:

public function routeNotificationForPushbullet()
{
    return new \NotificationChannels\Pushbullet\Targets\Channel($this->channel_tag);
}

Sending notification to all of the user's devices

public function routeNotificationForPushbullet()
{
    return new \NotificationChannels\Pushbullet\Targets\UserDevices();
}

via Method

On notification entity just add \NotificationChannels\Pushbullet\PushbulletChannel::class item to array that is returned from via method.

toPushbullet Method

In your notification class you also should define toPushbullet method which will return instance of \NotificationChannels\Pushbullet\PushbulletMessage.

/**
 * Get the pushbullet representation of the notification.
 *
 * @param  mixed  $notifiable
 * @return \NotificationChannels\Pushbullet\PushbulletMessage
 */
public function toPushbullet($notifiable)
{
    $url = url('/invoice/' . $this->invoice->id);

    return PushbulletMessage::create('Thank you for using our application!')
        ->link()
        ->title('One of your invoices has been paid!')
        ->url($url);
}

Available Message methods

  • note(): set notification type to note (title and message for notification are available)
  • link(): set notification type to link (title, message and url are available)
  • title($title): (string) set notification title
  • message($message): (string) set notification message
  • url($url): (string) set notification url (will be in notification if type is link)

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].