Download the PHP package noerd/notifications without Composer

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

noerd/notifications

Latest Stable Version

An extension package for noerd/noerd, the YAML-driven Livewire framework for multi-tenant Laravel applications. It plugs into the noerd top bar and the noerd user and tenant model — it is not a standalone Laravel package and does nothing without a noerd installation.

What it adds: in-app notifications for every app built on noerd — a bell in the top bar with a red badge for unread entries, a dropdown with the latest notifications, "Mark all as read", and a click that opens the notification's target. Every module of an application sends through one API — a service call, or a regular Laravel notification channel.

Features

Requirements

Installation

The install command runs the migration (one table, noerd_notifications). It registers no tenant app and publishes no configuration — the bell appears in the top bar of every app as soon as the package is installed.

Sending a notification

Through the service

Argument Meaning
userId, tenantId The recipient and the tenant the notification belongs to — always explicit, never taken from the session
title Shown in bold; stored already translated (translate with __() when sending)
body Optional second line
target Where a click leads (see below); null only marks the entry read
level info (default), success, warning or error — decides the icon colour
icon A heroicon name such as sparkles; an unknown name falls back to the bell
type A free key of the sender (reports.finished) for filtering and statistics

Through a Laravel notification

NoerdUser is Notifiable. A notification class that returns the channel from via() and a NoerdMessage from toNoerd() is stored exactly like a service call — and may send a mail through the regular channels at the same time:

Without a tenantId on the message the notifiable's currently selected tenant is used; a user without a tenant receives nothing (there is no bell to show it in).

Targets

A NotificationTarget has three shapes:

Shape Behaviour on click
route + arguments Opens the record as a modal through the named Route::livewire() route; the browser URL is rewritten to the record, so the notification stays shareable
component + arguments Fallback when the route is not registered (the owning module is not installed): opens the component as a modal
url Navigates to the page

Pass route AND component for a record — the route wins when it exists, the component keeps the click working otherwise. This is the Noerd::modalFor() contract of the framework.

Reacting to notifications

NoerdNotifications\Events\NotificationSent fires after every stored notification, with the Notification model as $event->notification. Listen to it to add a channel the module does not ship — a push message, a broadcast, a Slack post:

Housekeeping

Read notifications are kept until you prune them; unread ones stay until the user saw them. Schedule the command in your routes/console.php:

Updating

The update command publishes nothing (the package ships no YAML and no config); it exists so noerd:update-all covers the module.

Testing your own code

The model ships a factory:

Assert a sent notification with Notification::withoutGlobalScopes()->where('user_id', ...), or fake the NotificationSent event with Event::fake().

Development

See AGENTS.md for contributor notes. Tests (Pest):

Format with vendor/bin/pint (from a host: vendor/bin/pint --config app-modules/noerd-notifications/pint.json app-modules/noerd-notifications).

License

MIT — see LICENSE.


All versions of notifications with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
laravel/framework Version ^12.0 || ^13.0
noerd/noerd Version ^0.16.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 noerd/notifications contains the following files

Loading the files please wait ...