New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

rulecom/notifier

Send notification via Rule and other providers
63,775

Larablocks Analysis

rulecom/notifier works with Laravel 5 to 11 (latest release 1.2.9, Mar 1, 2025), all past end of life (the last on Mar 12, 2026): no more fixes, even for security.

Recommendation checks

Use with care

Use with care: meets 0 of 4 checks.

  • Supports only Laravel 5 to 11, past end of life since Mar 12, 2026
  • No release in the last 12 months (last: Mar 1, 2025)
  • 2,831 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Quiet
  • Last stable release: Mar 1, 2025.
  • No releases in the last 12 months.
  • First released: Aug 31, 2016.
  • Monthly downloads: 2,831.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 29, 2026.

Install
composer require rulecom/notifier
Latest Version:1.2.9
PHP:~5.5|~7.0|~8.1|~8.2
Laravel:5 – 11
License:MIT
Last Updated:Mar 1, 2025
Links: GitHub  ·  Packagist
Maintainer: Rule

Rule notifier

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Send notifications via Rule (email/text message) and Slack. Inspired by Laravels notification system and can be used with the Laravel framework or completely indipendent.

Install

Via Composer

$ composer require rulecom/notifier

Usage

To send notification you need to create notification objects. These objects are responsible for telling the Notifier via which channels the notification message should be sent through and what each corresponding channel message should contain.

use RuleCom\Notifier\Channels\Email;
use RuleCom\Notifier\Channels\Slack;

class UserHasRegistered
{
    /**
     * Here we specify through which channels we want to
     * send our notification.
    */
    public function via()
    {
        return ['email', 'slack'];
    }

    /**
     * Each via method needs a correspondng "to" method.
    */
    public function toEmail()
    {
        // Specify what the email message should contain.
    }

    /**
     * Each via method needs a correspondng "to" method.
    */
    public function toSlack()
    {
        // Specify what the Slack message should contain.
    }
}

// To send the notification to all specified channels:
$notifier = new RuleCom\Notifier\Notifier();
$notifier->send(new UserHasRegistered());

Channels

Currently this package supports the following channel providers:

  • Rule for sending email and text messages.
  • Slack for sending messages to Slack.
Email via (Rule):
public function toEmail()
{
    return (new RuleCom\Notifier\Channels\Email(new GuzzleHttp\Client()))
        ->apikey('YOUR-RULE-API-KEY') // If using Laravel you can set this in config/rule-notifier.php
        ->subject('Hello, world!')
        ->from([
            'name' => 'John Doe',
            'email' => 'john@doe.com'
        ])
        ->to([
            'name' => 'Jane Doe',
            'email' => 'jane@doe.com'
        ])
        ->content([
            'html' => '<h1>Notification sent via Rule!</h1>',
            'html' => 'Notification sent via Rule!'
        ]);
}
Slack:
public function toSlack()
{
    return (new RuleCom\Notifier\Channels\Slack(new GuzzleHttp\Client()))
        ->endpoint('YOUR-SLACK-INCOMING-WEBHOOK') // If using Laravel you can set this in config/rule-notifier.php
        ->channel('#notification') // Here you can override the channel specified in Slack, or send DM by passing @username
        ->message('Hello, world!');
}

Usage with Laravel

This package can be easily integrated with laravel, with the following benefits.

  • No need to pass in channel dependecies on your own.
  • Ability to specify configurations such as, api key for Rule and webhook for Slack.
  1. In your config/app.php add the following service provider
RuleCom\Notifier\LaravelServiceProvider::class
  1. Publish the config:
php artisan vendor:publish
// Without Laravel you will have to pass the channel dependency on your own:
(new RuleCom\Notifier\Channels\Slack(new GuzzleHttp\Client()))

// With Laravel you can resolve the channels with dependencies through the ioc container:
app(RuleCom\Notifier\Channels\Slack::class)

Debugging

If you need to debug a channel you may set it to debug mode. When a channel is in debug mode it will log the notification instead of dispatching the it to given channel.

To enable debug:

  1. Inject Monolog\Logger into the channel.
  2. Call the debug method and pass in a path to your logfile.
return (new RuleCom\Notifier\Channels\Slack(new GuzzleHttp\Client(), new Monolog\Logger('Notification logger')))
        ->debug('path/to/file.log') // If using Laravel you can set both debug mode and log path in config/rule-notifier.php
        ->endpoint('YOUR-SLACK-INCOMING-WEBHOOK') // If using Laravel you can set this in config/rule-notifier.php
        ->channel('#notification') // Here you can override the channel specified in Slack, or send DM by passing @username
        ->message('Hello, world!');

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email matthis.stenius@rule.se instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

uxweb/sweet-alert

A simple PHP package to show Sweet Alerts with the Laravel Framework

1,347,494 819
opb/laravel-hipchat

HipChat Notifier for Laravel 4

20,167 3
tdanandeh/sweet-alert

A simple PHP package to show Sweet Alerts with the Laravel Framework

5,726 1
mascame/notify

Notify is a package to rapidly notificate your users about something using Boots...

209 1
realrashid/sweet-alert

A beautiful, responsive, customizable, accessible (WAI-ARIA) replacement for Jav...

3,576,099 1,155

Version History

Version Released PHP Laravel License
1.2.9 ~5.5|~7.0|~8.1|~8.2 ~5.1|~6.2|~7.2|^8.38|^9.48|^10.0|^11.0 MIT
1.2.8 ~5.5|~7.0|~8.1 ~5.1|~6.2|~7.2|^8.38|^9.48 MIT
1.2.7 ~5.5|~7.0|~8.1 ~5.1|~6.2|~7.2|^8.38 MIT
1.2.6 ~5.5|~7.0 ~5.1|~6.2|~7.2|^8.38 MIT
1.2.5 ~5.5|~7.0 ~5.1|~6.2|~7.2|^8.38 MIT