Download the PHP package justpush/laravel-notification-channel without Composer

On this page you can find all versions of the php package justpush/laravel-notification-channel. 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 laravel-notification-channel

JustPush notification channel for Laravel

Send push notifications to iOS and Android through JustPush with Laravel's notification system: $user->notify(new OrderShipped($order)).

It uses the official JustPush PHP SDK to talk to the JustPush API.

Installation

The service provider registers itself. Add your API token to config/services.php:

You'll find your API token in the JustPush app.

Usage

toJustPush() can also return a plain string, which becomes the message text.

Who receives it

JustPush tokens belong to a JustPush account, and the push goes to that account's devices.

  1. Per user: add a route method to your notifiable model. Return null to fall back to the app token.

  2. App-wide: without a route, the channel uses services.justpush.token. That's handy for notifications to yourself or your team, e.g. $admin->notify(new NewSignup($user)).
  3. On demand:

If there's no token at all, the notification is skipped for this channel.

Message options

Method
create($message), message(), title() At least a message or a title is required.
topic($name) The topic name. An existing topic with that name is used, or a new one is created.
topicToken($token) Target a topic by its API token instead.
priority() -2…2 or lowest, low, normal, high, highest. Shortcuts: lowestPriority() … highestPriority().
sound($name) See JustPushMessage::SOUNDS. none is silent.
button($cta, $url, $actionRequired) Up to 10. Labels over 25 characters are cut.
buttonGroup($name, $cta, $buttons) Up to 4 groups of up to 10 buttons.
image(), imageData(), imageFile() Up to 10. The first image becomes the notification banner.
expiresIn($seconds) Hide the message after this many seconds.
acknowledge(...) Ask for an acknowledgement. Optionally re-send every retryEvery seconds (10–65535) up to maxRetries times (0–255), and have JustPush POST callbackParams plus the acknowledging device to callbackUrl, which must be publicly reachable.

Invalid values throw an InvalidArgumentException when you set them.

The response and errors

The channel returns the API's response, which Laravel passes to the NotificationSent event as $event->response:

When JustPush can't be reached or rejects the message, the channel throws NotificationChannels\JustPush\Exceptions\CouldNotSendNotification. getStatus() returns the HTTP status, or null for connection errors, and getErrors() returns per-field messages for a 422. Queue the notification (implements ShouldQueue) to get Laravel's retries.

Testing

License

MIT. See LICENSE.


All versions of laravel-notification-channel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.2
illuminate/notifications Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
justpush/justpush-php-sdk Version ^1.1
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 justpush/laravel-notification-channel contains the following files

Loading the files please wait ...