Code Monkey home page Code Monkey logo

nova-notifications's Introduction

โš ๏ธ Note: This repo is not maintained right now.

A Laravel Nova Tool for Handling Laravel Notifications

With this Nova tool:

  • You can overview all sent and failed notifications.
  • You can send out notifications. (depening on the notification's dependencies)
  • All sent or failed notifications will be stored in the database.

Latest Version on Packagist

screenshot of nova notifications overview screenshot of nova notifications send

Requirements

In order to use this package, you need to have an installation of Laravel with Laravel nova setup.

Installation

First install the Nova package via composer:

composer require christophrumpel/nova-notifications

Then publish the config file(optional):

php artisan vendor:publish --provider="Christophrumpel\NovaNotifications\ToolServiceProvider"

In there, you can define where to look for the Notification classes, as well as the notifiable models.

<?php
return [
    /*
     * The namespaces you want to check for Notification classes.
     */
    'notifiableNamespaces' => [
        'App',
    ],
    /*
     * The namespaces you want to check for Notifiable classes.
     */
    'notificationNamespaces' => [
        'App\Notifications',
        'Illuminate',
    ],
];

Next up, you must register the tool via the tools method of the NovaServiceProvider.

// inside app/Providers/NovaServiceProvder.php

// ...

public function tools()
{
    return [
        // ...
        new \Christophrumpel\NovaNotifications\NovaNotifications()
    ];
}

You also need to run php artisan migrate on your Laravel application so that the new notifications table will be created.

Usage

After installing the tool, you should see the new sidebar navigation item for Notifications.

Overview

On the Overview page you can see all of the sent and failed notifications. This only works for notifications sent after installing this package.

Usually, only the notifications sent through the database channel will be stored in the database. This package comes with a new nova_notifications table, where all of them get stored.

Send

On the Send page you can see all of your created notification classes.

If you don't see a newly created notification class, try running composer dump-autoload.

Parameters

Since you notifications often depend on parameters, this package tries to help you with that. All found constructor parameters will be shown when you try to send a notification. If one of the dependencies is an Eloquent Model, you will get a list with all of the items to choose from.

screenshot of nova notifications send

If you want to create a new notification with custom objects, then this approach will not work for now. If you have a custom use-case, let me know about it, and we can think of a solution.

Testing

phpunit tests

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security-related issues, please email me at [email protected] instead of using the issue tracker.

License

The MIT License (MIT).

nova-notifications's People

Contributors

richardbishopme avatar marceauka avatar christophrumpel avatar shalawani avatar masterix21 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.