Download the PHP package tobento/app-notifier without Composer

On this page you can find all versions of the php package tobento/app-notifier. 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 app-notifier

App Notifier

App Notifier provides powerful and flexible notification support for Tobento applications.
It builds on the underlying Notifier Service and adds:

Whether you need real-time browser updates, guest notifications, or persistent storage-based messages, App Notifier gives you a consistent API and a clean integration layer for your Tobento App.

Table of Contents

Getting Started

Add the latest version of the app notifier project running this command.

Requirements

Documentation

App

Check out the App Skeleton if you are using the skeleton.

You may also check out the App to learn more about the app in general.

Notifier Boot

The Notifier boot integrates the notifier system into your application.
It performs the following tasks:

Below is an example of how to initialize the app with the Notifier boot:

Notifier Config

The configuration for the notifier is located in the app/config/notifier.php file of the default App Skeleton.

This file allows you to configure all notifier-related settings, including:

You can adjust this configuration to match the needs of your application.

Channels

Supported Channels

By default, the following channels are supported:

Available Channels

Available channels represent the channels that are currently active and usable in your application.
They can be used to:

By default, all channels defined in the app/config/notifier.php file are available.

Features

Browser Feature

The Browser Feature enables pull-based browser notifications for authenticated users.
Authentication is handled automatically through the application's user system.

This feature boots the following user-related components:

Because of this, the Browser Feature works out of the box with the default user system.
If you need web-based authentication, you may install app-user-web.

The authenticated user is resolved from the request via:

The feature then checks:

If any of these conditions fail, an AuthorizationException is thrown.

Requirements

This feature requires the Browser View Feature which automatically injects its required view snippet into your layout using autoRenderOnView.

Config

You can configure the Browser Feature in the Notifier Config file:

ACL Permissions

To receive browser notifications, a user must have the following permission:

If using the App Backend, you can assign this permission on the Roles or Users page.

How Notifications Are Delivered

When the browser polls the route:

The feature:

This is handled in the browser() method of the feature.

Browser Stream Feature

The Browser Stream Feature enables real-time browser notifications using Server‑Sent Events (SSE).
Unlike the Browser Feature, which relies on polling, this feature pushes notifications to the browser instantly as they occur.

Authentication is handled automatically through the application's user system.

This feature boots the following user-related components:

Because of this, the Browser Stream Feature works out of the box with the default user system.
If you need web-based authentication, you may install app-user-web.

The authenticated user is resolved from the request via:

The feature then checks:

If any of these conditions fail, an AuthorizationException is thrown.

Requirements

This feature requires the Browser View Feature which automatically injects its required view snippet into your layout using autoRenderOnView.

Config

You can configure the Browser Stream Feature in the Notifier Config file:

ACL Permissions

To receive browser notifications, a user must have the following permission:

If using the App Backend, you can assign this permission on the Roles or Users page.

How Notifications Are Delivered

When the browser connects to the SSE endpoint:

The feature:

This is handled in the browser() method of the feature.

Browser Guest Feature

The Browser Guest Feature enables browser notifications for guest users (non-authenticated visitors).
This is useful when your application needs to display notifications to users who are not logged in, such as storefront visitors, checkout flows, or public-facing pages.

Guest notifications are handled separately from authenticated user notifications and do not require a user account.

This feature boots the following user-related components:

Because of this, the Browser Guest Feature works out of the box with the default user system.
If you need web-based authentication for other features, you may install app-user-web.

Guest notifications do not require an authenticated user.
Instead, the feature identifies the guest using a unique guest token stored in the session or cookie.

This feature does not require the Browser View Feature.

The feature registers its own view handler internally and will only render the snippet if:

If these conditions are not met, the view is not rendered.

Config

You can configure the Browser Guest Feature in the Notifier Config file:

ACL Permissions

To receive browser notifications, a user must have the following permission:

If using the App Backend, you can assign this permission on the Roles or Users page.

How Guest Notifications Are Delivered

When the browser polls the guest endpoint:

The feature:

This is handled in the browser() method of the feature.

Sending Notifications

See Using Guest Recipient for how to send notifications to guests.

Browser View Feature

The Browser View Feature provides the view snippet required for enabling browser notifications in your application's layout.
It does not register routes or deliver notifications - it only injects the JavaScript and HTML needed for the browser to poll or stream notifications.

This feature boots the following components:

Because of this, the Browser View Feature works out of the box with the default view system.

Config

You can configure the Browser View Feature in the Notifier Config file:

What This Feature Does

The feature registers a handler for the view key:

This handler:

If any condition fails (ACL, user preference, missing route), the snippet is not rendered.

Creating And Sending Notifications

Using General Recipients

For more details, see the Notifier Service - Creating And Sending Notifications.

Example sending to the current user (authenticated or guest)

Make sure you have booted:

If any browser features are enabled, it is automatically booted.

Using Guest Recipient

For more details, see the Notifier Service - Guest Recipient.

For more details, see the Notifier Service - Creating And Sending Notifications.

Browser Message

Use the browser message type to send notifications to the in-browser js-notifier UI.

js-notifier parameters

You can find the full list of supported js-notifier parameters here: https://github.com/tobento-ch/js-notifier#parameters

Formatters

If you use action parameters (action_text, action_route, etc.), ensure the General Notification Formatter is enabled. This formatter is enabled by default.

Using AbstractNotification

Queuing Notifications

Sending notifications can be a time-consuming task. To avoid delays during request handling, you can queue notification messages for background processing.

To queue a notification, simply add the Queue Parameter to your message:

Example

The App Queue Boot, enabling queue support out of the box.

You only need to configure your queues in the Queue Config file.

Notification Formatters

Notification formatters may be used to format notifications stored by the Storage Channel or the Browser Channel.

General Notification Formatter

You may use the general formatter, which uses the following message data:

In :

The and values will be used to generate the message URL if you have installed the App Http - Routing Boot.

The and values will be translated by the formatter if you have installed the App Translation Boot.

General Formatter Example

You may create your own general formatter for notifications:

In :

Creating Notification Formatters

You may create a specific formatters to format only certain notifications:

In :

Custom Notifications

You may easily customize notifications by defining them in the app/config/notifier.php file:

Creating Custom Notification

Creating Notification Factory

Console

Clear Notifications Command

If you have installed the App Console, you may clear all notifications from channels that support it, such as the Storage Channel and Browser Channel, using the user:notifications:clear command.

Clearing all notifications from all supported channels

Clearing all notifications from all specific channels

Available Options

Option Description
--channel=name The name(s) of the channel(s) to clear.
--read-only Clears only notifications that are marked as read.
--unread-only Clears only notifications that are unread.
--older-than-days=10 Clears notifications older than the specified number of days.

App Notification Integration

You may also want to explore the App Notification package, which provides seamless integration of notifications into your application.

Credits


All versions of app-notifier with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
tobento/app Version ^2.0
tobento/app-migration Version ^2.0
tobento/app-queue Version ^2.0
tobento/app-http Version ^2.0
tobento/app-encryption Version ^2.0
tobento/app-language Version ^2.0
tobento/app-mail Version ^2.0
tobento/app-database Version ^2.0
tobento/app-translation Version ^2.0
tobento/app-view Version ^2.0
tobento/app-user Version ^2.0
tobento/service-collection Version ^2.0
tobento/service-autowire Version ^2.0
tobento/service-clock Version ^2.0
tobento/service-notifier Version ^2.0
tobento/service-repository-storage Version ^2.0
tobento/js-notifier Version ^1.0
symfony/vonage-notifier Version ^7.3
psr/container Version ^2.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 tobento/app-notifier contains the following files

Loading the files please wait ...