Download the PHP package mhd-elawi/notification without Composer

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

Notification Package

Table of Contents

  1. Introduction
  2. Features
  3. Installation
    • Install the Package
    • Publish Configuration and Migrations
    • Run Migrations
  4. Configuration

    • Default Language
    • Supported Languages
    • Save Notifications

    • Firebase Configuration
  5. Usage
    • Sending Notifications
      • Implementing HasNotification
    • Disabling Persistence
    • Disabling Notification
    • Advanced Configuration
  6. Contributing

Introduction

The Notification Package is a Laravel package designed for managing multi-language notifications with support for:


Features


Installation

Install the Package

Run the following command:

Publish Configuration and Migrations

Publish Configuration File

Publishes the configuration file to config/notification.php.

Publish Migrations

Publishes the migration files to database/migrations.

Run Migrations

Run the migrations:


Configuration

Default Language

Set the default language for notifications:

If a language is not specified for a notification, it will fall back to this language.

Supported Languages

Define the list of supported languages:

Save Notifications

By default, notifications are saved to the database:

Firebase Configuration

Firebase configuration is optional. If using Firebase, configure the following:

Firebase Credentials

Set the path to the service account credentials in the .env file:

Firebase Project ID

Set the Firebase Project ID in the .env file:

Enable FCM

Enable Firebase notifications in the configuration file:


Usage

Sending Notifications

Single User Notification

Multi-Language Notification

Multi-Language Notifications :

Batch Notification

Notification with Related Data

The related model in notifications allows associating a notification with a specific entity (e.g., a Post, Order, or Comment). This is achieved through a morph relationship in the notification model. When sending a notification, the related model's type (related_type) and ID (related_id) are included in the Firebase notification payload, allowing the frontend to handle and display notifications dynamically.

How It Works: Morph Relationship in Notification Model The notification system supports polymorphic relations, meaning a notification can be associated with any model (e.g., Post, Order, User).

Sending Related Model in Firebase Payload

When a related model is assigned, its model type and model ID are sent as part of the Firebase notification payload. This allows the frontend to recognize which entity the notification refers to and navigate users to the appropriate screen.

Alternatively, you can use setRelatedModel() to assign the related model separately:

Notification with Extra Fields

Set extra fields for the notification. like (Image, Color, Sound, Tag)


Implementing HasNotification

If using Firebase ensure your Recipient model implements the HasNotification interface:


Disabling Persistence

Disable in Configuration

Disable Per Notification


Disable Sending Notification

You can disable notifications for a specific notification or globally.

Disable in Configuration

Disable for a Specific Notification

Use disableSendNotification() to prevent sending this specific notification.

Advanced Configuration

Batch Processing

comment: <> ()

Customize Table Names

Update table_names in the configuration file to match your database schema.


Contributing

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Submit a pull request with a detailed description of your changes.

All versions of notification with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0 | ^11.0
astrotomic/laravel-translatable Version ^11.12
google/auth Version ^1.41
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 mhd-elawi/notification contains the following files

Loading the files please wait ...