mblsolutions/notifications

Notification package for Laravel applications

v1.x-dev 2024-04-04 15:06 UTC

This package is auto-updated.

Last update: 2024-11-04 16:17:19 UTC


README

This package is for sending messages via a number of channels. Currently implemented is: Microsoft Teams, Mail, Log file

Installation

The recommended way to install Inspired Deck Larvel is through Composer.

composer require mblsolutions/notifications

Laravel without auto-discovery

If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php

\MBLSolutions\Notifications\NotificationsServiceProvider::class,

Usage

Copy the package config to your local config with the publish command:

php artisan vendor:publish --provider="MBLSolutions\Notifications\NotificationsServiceProvider"

A new config file will be available in config/notifications.php.

The config uses sensible defaults, but you can change these via .env variables

NOTIFICATIONS_CHANNEL=stack # Options: stack, log, teams, mail
NOTIFICATIONS_LOG_CHANNEL=single # This should be one of the options in config('logging.channels')
NOTIFICATIONS_TEAMS_WEBHOOK_URL= # You must set this up via following this guide: https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-outgoing-webhook
NOTIFICATIONS_MAILER=smtp # This should be one of the options in config('mail.mailers')
NOTIFICATIONS_MAIL_FROM_ADDRESS= # The default from mail address
NOTIFICATIONS_MAIL_FROM_NAME= # The default from mail name
NOTIFICATIONS_MAIL_TO_ADDRESS= # The default to mail address
NOTIFICATIONS_MAIL_TO_NAME= # The default to mail name