Download the PHP package deadbyback/yii2-notifications without Composer

On this page you can find all versions of the php package deadbyback/yii2-notifications. 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 yii2-notifications

:bell: Notifications for Yii2

This Yii2 extension provides support for sending notifications across a variety of delivery channels, including mail, SMS, Slack, Telegram etc. Notifications may also be stored in a database so they may be displayed in your web interface.

Typically, notifications should be short, informational messages that notify users of something that occurred in your application. For example, if you are writing a billing application, you might send an "Invoice Paid" notification to your users via the email and SMS channels.

Latest Stable Version Scrutinizer Code Quality Build Status Code Climate

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Usage

The following example shows how to create a Notifier instance and send your first notification:

Notifier is often used as an application component and configured in the application configuration like the following:

Once the component is configured it may be used for sending notifications:

Each notification class should implement NotificationInterface and contain a viaChannels method and a variable number of message building methods (such as exportForMail) that convert the notification to a message optimized for that particular channel. Example of a notification that covers the case when an invoice has been paid:

You may use the NotifiableInterface and NotifiableTrait on any of your models:

Database notifications

The database notification channel stores the notification information in a database table.
You can query the table to display the notifications in your application's user interface. But, before you can do that, you will need to create a database table to hold your notifications. To do this, you can use the migration that comes with this extension:

or

Accessing The Notifications
Once notifications are stored in the database, you need a convenient way to access them from your notifiable entities. The NotifiableTrait, which comes with this extension, includes a notifications relationship that returns the notifications for the entity. To fetch notifications, you may access this method like any other ActiveRecord relationship.

If you want to retrieve only the "unread" notifications, you may use the unreadNotifications relationship.

You can access custom JSON data that describes the notification and was added using DatabaseMessage:

Marking Notifications As Read
Typically, you will want to mark a notification as "read" when a user views it. The ReadableBehavior in Notification model provides a markAsRead method, which updates the read_at column on the notification's database record:


All versions of yii2-notifications with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
yiisoft/yii2 Version ~2.0.13
yiisoft/yii2-httpclient 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 deadbyback/yii2-notifications contains the following files

Loading the files please wait ....