Download the PHP package neo/pusher-beams without Composer

On this page you can find all versions of the php package neo/pusher-beams. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pusher-beams

Pusher Beams - push notifications for Laravel

Latest Version on Packagist Build Status StyleCI Quality Score

This package makes it easy to send Pusher push notifications with Laravel (should work with other non-laravel PHP projects). It's based off this package by Mohamed Said.

Contents

Installation

You can install the package via composer:

...

Setting up your Pusher account

...

Usage

Update your .env file with the following keys:

💡 You need to replace the PUSHER_BEAMS_SECRET_KEY and PUSHER_BEAMS_INSTANCE_ID keys with the keys gotten from your Pusher dashboard.

Open the broadcasting.php file in the config directory and add the following keys to the pusher connection array:

'connections' => [
    'pusher' => [
        // [...]

        'beams' => [
            'secret_key' => env('PUSHER_BEAMS_SECRET_KEY'),
            'instance_id' => env('PUSHER_BEAMS_INSTANCE_ID'),
        ],

        // [...]
    ],
],

Next, create a new notification class where we will add our push notification. In your terminal run the command below to create the class:

$ php artisan make:notification UserCommented

This will create a new UserCommented class in the app/Notifications directory. Open the file and you can do something similar to this sample class:

<?php

namespace App\Notifications;

use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Neo\PusherBeams\PusherBeams;
use Neo\PusherBeams\PusherMessage;
use App\User;
use App\PhotoComment;
use App\Photo;

class UserCommented extends Notification
{
    use Queueable;

    public $user;

    public $comment;

    public $photo;

    public function __construct(User $user, Photo $photo, PhotoComment $comment)
    {
        $this->user = $user;

        $this->comment = $comment;

        $this->photo = $photo;
    }

    public function via($notifiable)
    {
        return [PusherBeams::class];
    }

    public function toPushNotification($notifiable)
    {
        return PusherMessage::create()
            ->iOS()
            ->sound('success')
            ->title('New Comment')
            ->body("{$this->user->name} commented on your photo: {$this->comment->comment}")
            ->setOption('apns.aps.mutable-content', 1)
            ->setOption('apns.data.attachment-url', $this->photo->image);
    }

    public function pushNotificationInterest()
    {
        $id = $this->photo->id;

        $audience = strtolower($this->user->settings->notification_comments);

        return "photo_{$id}-comment_{$audience}";
    }
}

In the class above we are extending a Notification class and we have implemented the toPushNotification method, which will be used to send the push notification when required. In the via method, we specify what channels we want to send the notification through and in the pushNotificationInterest we specify the interest we want to publish the push notification to.

Sending to multiple platforms

...

Routing a message

...

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

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.


All versions of pusher-beams with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
illuminate/events Version 5.5.* || 5.6.* || 5.7.* || ^6.0 || ^7.0
illuminate/notifications Version 5.5.* || 5.6.* || 5.7.* || ^6.0 || ^7.0
illuminate/queue Version 5.5.* || 5.6.* || 5.7.* || ^6.0 || ^7.0
illuminate/support Version 5.5.* || 5.6.* || 5.7.* || ^6.0 || ^7.0
pusher/pusher-push-notifications Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package neo/pusher-beams contains the following files

Loading the files please wait ....