Download the PHP package kiwilan/notifier-laravel without Composer
On this page you can find all versions of the php package kiwilan/notifier-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package notifier-laravel
Notifier for Laravel
Notifier for Laravel is a package to send notifications (with Notifier
) and monitoring (with Journal
), built for Discord, Slack and mails.
Based on kiwilan/php-notifier
.
[!IMPORTANT] This package does not support push notifications or SMS (if you interested, a PR is welcome) on
kiwilan/php-notifier
.
About
Laravel offers a built-in Notification and Laravel Logging systems, this package is an alternative to these systems.
Notifier
allows to send notifications without link to a user model and advanced and Journal
is based on Log
facade. Journal
can write logs send notifications and write logs in the database with filament/notifications
package (not included and not required).
When native Laravel notifications are for users, this package is designed for developers to help for debugging and monitoring, but you can use it for users too.
This package offer a support for Discord and Slack webhooks, but Slack has only basic support (without legacy API support), for more, you can use laravel/slack-notification-channel
. To avoid dependencies, this package doesn't use it.
- Discord webhooks: support message and rich embeds.
- Slack webhooks: support message, attachments.
- Mail: support message and attachments with
symfony/mailer
.
Installation
You can install the package via composer:
You can publish the config file with:
[!NOTE] The configuration file is totally optional, if you have multiple webhooks, you can create your own configs to send notifications.
This is the contents of the published config file:
Usage
Journal
Journal is a utility class for Laravel Logging.
To database
You can use Journal to log in the database with filament/notifications
package (you have to install it).
This method will search App\Models\User::class
and get all users with canAccessPanel()
allowed, by default all users with access will be notified.
To notifier
You can use Journal to send a notification with discord
, mail
or slack
(you have to set the config file).
Handler
You can use Journal as a handler for Laravel Exceptions.
toDatabase
is a boolean to log the exception in the database withfilament/notifications
package (you have to install it).toNotifier
is a string to send a notification withdiscord
,mail
orslack
(you have to set the config file).
Notifier
Notifier is an alternative to Laravel Notifications.
[!NOTE] If
notifier.journal.debug
istrue
,debug
level logs will be written for sending and sent notifications. In all cases,error
level logs will be written for sending errors.
For HTTP client, you can configure notifier.client
in the config file with stream
, curl
or guzzle
and override it with second parameter for Discord, Slack and HTTP.
Discord
Default webhook URL, username and avatar URL can be set in the config file.
You can pass a custom webhook URL:
Default mailer
, host
, port
, username
, password
, encryption
, from address
, from name
, to address
and to name
can be set in the config file.
You can use NOTIFIER_MAIL_LARAVEL_OVERRIDE
to use Laravel mailer instead of package mailer.
You can pass a custom mailer:
Slack
Default webhook URL can be set in the config file.
You can pass a custom webhook URL:
HTTP
You can use Notifier to send a request with http
method. URL can be null if you set it in the config file with notifier.http.url
.
Command
You can use Notifier as a command to send a notification with discord
, mail
or slack
.
Two options are available:
-t
or--type
to set the type of notification, default ismail
.-w
or--webhook
to set the webhook URL (only fordiscord
andslack
). If not set, the default webhook URL from the config file will be used.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ewilan Rivière
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of notifier-laravel with dependencies
illuminate/contracts Version ^10.0 || ^11.0
kiwilan/php-notifier Version ^0.0.40
spatie/laravel-package-tools Version ^1.14.0