Download the PHP package asignua/filament-notification-preferences without Composer

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

Filament Notification Preferences

Stand With Ukraine Latest Version on Packagist Tests License

Filament Notification Preferences

Panel users get mails and notifications they cannot switch off, and ask the developer. This plugin adds a page where every user picks, per notification type and per channel, what they receive - without changing a single notification class. You declare the types once (class, label, description, group, channels, default, optionally locked); a listener on Laravel's NotificationSending event then cancels what the recipient turned off.

Screenshots

The matrix

Dark mode

On a phone every row becomes a card whose checkboxes are labelled with their channel.

Requirements

Installation

The migration is a publishable stub, it is not loaded automatically. Optionally publish the config (--tag=filament-notification-preferences-config) and the translations (--tag=filament-notification-preferences-translations).

Register the plugin on the panel:

Declaring the types

Do it in a service provider, so it also runs in a queue worker (which has no panel):

(NotificationPreferencesPlugin::make()->types([...]) does the same from the panel provider.)

Asking from code

allows() fails open (see above). save() ignores undeclared keys, locked types, channels the type lacks and non-boolean values.

Who may open the page

By default any signed-in user - and the page only ever reads and writes the signed-in user's own choices; the recipient is never a request parameter. To narrow it, define the gate canManageNotificationPreferences and/or use ->visible(fn ($user) => ...) on the plugin (it can only narrow what the gate allows). The check is repeated on every Livewire action, not only on mount.

To put the matrix into your own profile page instead: ->withoutPage() and render @livewire(\Asignua\FilamentNotificationPreferences\Livewire\PreferencesMatrix::class).

Configuration

config/filament-notification-preferences.php: connection, table, model, and cache (enabled, store, ttl). Plugin methods: navigationGroup(), navigationLabel(), navigationIcon(), navigationSort(), slug(), navigation(false), userMenu(bool|string), visible(), withoutPage(), types().

Recipes

filament-chat. Its notifications are plain classes:

filament-kanban-pro and filament-mail-log send their messages with Filament's Notification::...->sendToDatabase(). That method wraps every message in the same class (Filament\Notifications\DatabaseNotification), so there is nothing to tell the kanban notify step from a bounce alert by type, and they cannot be governed one by one. The only handle is the class itself, which switches all sendToDatabase() messages of the application on or off together:

Use that only when "all in-app panel messages" is a choice you want to give. Otherwise leave them out: unknown means sent.

Gotchas

Translations

The interface ships in English, Ukrainian, German, Spanish, French, Italian, Dutch, Polish, Brazilian Portuguese and Turkish under the filament-notification-preferences::filament-notification-preferences namespace. English and Ukrainian are written by hand; the other eight are machine translations - corrections are welcome. A test keeps every language in step with the English keys and placeholders. Override a string by publishing the translations and editing the copy in lang/vendor/filament-notification-preferences.

AI agents

The package ships Laravel Boost guidelines (resources/boost/guidelines/core.blade.php) so a coding agent wires it up correctly.

Testing

NPREF_DB=mariadb|pgsql (with NPREF_DB_HOST, NPREF_DB_PORT; database/user npref, password secret) runs the same suite against a real server. One test starts a separate queue:work process against the same database.

Changelog

See CHANGELOG.md.

More plugins by asign

All plugins: https://filamentphp.com/plugins?q=asign

License

The MIT License (MIT). See LICENSE.md.


All versions of filament-notification-preferences with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
filament/filament Version ^5.11.2
illuminate/contracts Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
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 asignua/filament-notification-preferences contains the following files

Loading the files please wait ...