This is a custom system notification channel.

v1.0.3 2023-02-24 12:57 UTC

This package is auto-updated.

Last update: 2024-04-24 15:28:25 UTC


README

68747470733a2f2f706e672e706e67747265652e636f6d2f706e672d766563746f722f32303139303830362f6f75726c617267652f706e67747265652d616c6572742d62656c6c2d6e6f74696669636174696f6e2d736f756e642d626c75652d646f747465642d6c696e652d6c696e652d69636f6e2d706e672d696d6167655f313635313830342e6a7067

Makes Laravel Notification a Breeze...
68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6465762d746563686775792f6e6f7465 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6465762d746563686775792f6e6f7465 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6465762d746563686775792f6e6f7465 68747470733a2f2f706f7365722e707567782e6f72672f6465762d746563686775792f6e6f74652f762f737461626c65 68747470733a2f2f706f7365722e707567782e6f72672f6465762d746563686775792f6e6f74652f646f776e6c6f616473

This package is custom notify for any model, so instead of using laravel notification. I built this custom notification package for my projects, so if you want to try it out read through the documentation.

Installing

The recommended way to install dev-techguy/note is through Composer.

# Install package via composer
composer require dev-techguy/note

Next, run the Composer command to install the latest stable version of dev-techguy/note:

# Update package via composer
 composer require dev-techguy/note --lock

After installing, the package will be auto discovered, But if need you may run:

# run for auto discovery <-- If the package is not detected automatically -->
composer dump-autoload

Then run this, to get the config/note.php for configurations:

# run this to get the configuartion file at config/note.php <-- read through it -->
php artisan vendor:publish --provider="Note\NoteServiceProvider"

You will have to provide this in the .env for the api configurations:

# This is the pagination number you want to paginate with <-- default(10) -->
NOTE_NOTIFICATION_PAGINATE=

# set all the guards to use within the system
SYSTEM_GUARDS=admin,web

Usage

Follow the steps below on how to use the package:

# On the relating model use
public function notification(){
 return #the relationship
}
   use Note\Note;
  /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct() {
        //The instance should be your guard either admin,auth on so on.
    }

    /**
     * ---------------------------------
     * Read a notification.
     * ---------------------------------
     */
    public function readNotification() {
        Note::readNotification(PassNotificationID);//Pass notification model id.
    }

    /**
     * ---------------------------------
     * Read a trashed notification.
     * ---------------------------------
     */
    public function readTrashedNotification() {
        Note::readTrashedNotification(PassNotificationID);//Pass notification model id.
    }

    /**
     * ---------------------------------
     * Fetch Latest Notification Here
     * ---------------------------------
     */
    public function latestNotifications() {
        Note::latestNotifications();
    }

    /**
     * --------------------------------
     * Fetching all notifications
     * --------------------------------
     */
    public function allNotifications() {
        Note::allNotifications();
    }

    /**
     * --------------------------------
     * Fetching all unread notifications
     * --------------------------------
     */
    public function unreadNotifications() {
        Note::unreadNotifications();
    }

    /**
     * =-------------------------------
     * Deleting a single notification
     * ------------------------------------------------------------------------------
     * To achieve single notification create a route that receives a (string) notification_id
     * Note that this package uses uuids so the notification_id has to be a string
     * ----------------------------------------------------------------------------------------
     */
    public function deleteSingleNotification(string $notification_id) {
        Note::deleteSingleNotification($notification_id);//Pass notification model id.
    }

    /**
     * =-------------------------------
     * Deleting a trashed notification
     * ------------------------------------------------------------------------------
     * To achieve single notification create a route that receives a (string) notification_id
     * Note that this package uses uuids so the notification_id has to be a string
     * ----------------------------------------------------------------------------------------
     */
    public function deleteTrashedNotification(string $notification_id) {
        Note::deleteTrashNotification($notification_id);//Pass notification model id.
    }

    /**
     * =-------------------------------
     * Deleting a all notification
     * --------------------------------
     */
    public function deleteAllNotifications() {
        Note::deleteAllNotifications();
    }
    
   /**
     * --------------------------------------
     * Fetch the trashed notifications here
     * --------------------------------------
    */
    public function trashedNotifications(){
         Note::trashedNotifications();
    }
    
    
   /**
     * ------------------------------------------
     * Clear all the trashed notifications here
     * -----------------------------------------
    */
    public function clearTrashedNotifications(){
         Note::clearTrashedNotifications();
    }

    /**
     * --------------------------------
     * Creating new notification here
     * --------------------------------
     * In creating notification we need 4 parameters are required
     * -------------------------------------------------------------------------------------------------------
     */
    public function createSystemNotification() {
        //This is for creating user notifications
        Note::createSystemNotification('This will be the Model class i.e App\User','My Notification Subject', 'My Notification Message');
    }


    /**
     * ---------------------------
     * TODO SIMPLE PACKAGE NOTES
     * -----------------------------------------------------------------------------------------
     * For the functions used above can be changed to your own names to call the package names
     * -----------------------------------------------------------------------------------------
     */

Version Guidance

Version Status Packagist Namespace Repo
1.x Latest dev-techguy/note Note/NoteServiceProvider v1.0.1

Security Vulnerabilities

For any security vulnerabilities, please email to TechGuy.

License

This package is open-source software licensed under the MIT license.