Laravel 5.3+ Notifications Pushed Driver

dev-master 2018-09-15 12:32 UTC


This package makes it easy to send notifications using Pushed with Laravel 5.3+.



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

$ composer require pendonl/laravel-notifications-channel-pushed

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

    "require": {
        "pendonl/laravel-notifications-channel-pushed": "^1.0"

You will also need to install guzzlehttp/guzzle http client to send request to Pushed API.

If you use Laravel 5.5 or higher, you don't need the following step. If not, once package is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.

  • PendoNL\LaravelNotificationsChannelPushed\PushedServiceProvider::class

Setting up the Pushed service

Login to Pushed, create a new app or edit an existing one. Navigate to App Settings and find the App Key and App Secret around the bottom of the page. You need to put it to config/services.php configuration file. You may copy the example configuration below to get started:

'pushed' => [
    'app_key' => env('PUSHED_APP_KEY', ''),
    'app_secret' => env('PUSHED_APP_SECRET', '')

Put these Environment keys in the .env file of your project



First of, create or edit a Notification of your choice. In order to send notifications using this channel you have to specify a toPushed method on your Notification.

The toPushed Method

 * Get the Pushed representation of the notification.
 * @param  mixed  $notifiable
 * @return \PendoNL\LaravelNotificationsChannelPushed\PushedMessage
public function toPushed($notifiable)
    $url = url('/thanks');
    return PushedMessage::create('Thank you for using our application!')

Available Message methods

  • setUrl($url): (string) adds a URL action to the notification
  • toApp(): sends the notification to all users registered to your app
  • toChannel($alias): (string) sends the notification to a given channel alias
  • toUser($accessToken): (string) sends the notification to a user that registered to your app using OAuth
  • toPushedId($pushedId): (string) sends the notification directly to a user's Pushed ID


$ composer test


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


Please feel free to Fork this project and make improvements. Create a Pull request with sufficient information about what improvements or changes you've made.



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