Download the PHP package gsouillard/laravel-new-user-slack-notifier without Composer
On this page you can find all versions of the php package gsouillard/laravel-new-user-slack-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gsouillard/laravel-new-user-slack-notifier
More information about gsouillard/laravel-new-user-slack-notifier
Files in gsouillard/laravel-new-user-slack-notifier
Package laravel-new-user-slack-notifier
Short Description A Laravel package to send Slack notifications on user registration.
License MIT
Informations about the package laravel-new-user-slack-notifier
Laravel New User Slack Notifier
A Laravel package to send Slack notifications when a new user registers on your application.
Installation
You can install the package via Composer:
Configuration
After installing the package, publish the configuration file:
This will create a configuration file named slack-new-user-notifier.php
in your config
directory.
Configuration Options
- webhook_url: The Slack Webhook URL where the notifications will be sent. This should be set in your
.env
file asSLACK_NEW_USER_NOTIFIER_WEBHOOK_URL
. - app_name: The name of your application, which will be included in the Slack notification. It defaults to the
APP_NAME
defined in your.env
file, but you can override it in the configuration file. - event_to_listen: Determines which event to listen to. You can set this to
Registered
(default) orVerified
to send notifications based on the specific event.
Example configuration:
Usage
This package works by listening to either the Registered
or Verified
events in Laravel. By default, it listens to the Registered
event. You can change this by setting the event_to_listen
configuration option.
In your EventServiceProvider
, the package automatically registers the listener based on your configuration:
Example .env Configuration
In your .env
file, add:
Set SLACK_NEW_USER_NOTIFIER_EVENT
to Verified
if you want to send notifications only after the user verifies their email.
Testing
To run the tests, you can use PHPUnit:
Commit Rules and Versioning
This project follows semantic versioning. When making changes, use the following commit message conventions to automatically update the package version:
- Major Version Bump: For breaking changes, include
bump:major
in your commit message. - Minor Version Bump: For adding backward-compatible features, include
bump:minor
in your commit message. - Patch Version Bump: For backward-compatible bug fixes or minor improvements, include
bump:patch
in your commit message.
Example commit messages:
Fix critical issue bump:major
Add new feature bump:minor
Fix minor bug bump:patch
License
The MIT License (MIT). Please see License File for more information.