PHP code example of technovistalimited / notific

1. Go to this page and download the library: Download technovistalimited/notific library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

technovistalimited / notific example snippets


Technovistalimited\Notific\NotificServiceProvider::class,

'Notific' => Technovistalimited\Notific\Facades\Notific::class,

 Notific::notify( $userId, $message, $notificationType, $metaData, $createdBy );
 

 Notific::getNotifications( $userId, $arguments );
 

 Notific::getNotificationCount( $userId, $status );
 

Notific::markNotificationRead( $userId, $notificationId );
 

// Notified with a simple message.
Notific::notify( 21, 'Your application submitted.' ) );

// Notified with a message and date.
Notific::notify( 21, sprintf( 'Your application submitted on %s is approved.', date('d F Y') ) );

// Notified with a different type of notification.
Notific::notify( 21, 'Your application submitted.', 'message' ) );

// Notified with some meta data incorporated.
Notific::notify( 21, 'Your application is approved. Click to see it.', 'notification', array('link' => 'http://link.to/the/application/' ) ) );

// Notified with someone who (with ID 8) assigned the notification
Notific::notify( 21, 'Your application submitted.', 'notification', '', 8 ) );

// Notify multiple users (with ID 21, 4, and 5) at a time
Notific::notify( [21, 4, 5], 'An application is submitted. Please check.' );

// Get all the notifications.
Notific::getNotifications( 21 );

// Get unread notifications only.
Notific::getNotifications( 21, array( 'read_status' => 'unread' ) );

// Get read notifications only.
Notific::getNotifications( 21, array( 'read_status' => 'read' ) );

// Get read notifications and maximum 10 of them only.
Notific::getNotifications( 21, array( 'read_status' => 'all', 'items_per_page' => 10 ) );

// Get all notifications and paginate them to 50 per page only.
Notific::getNotifications( 21, array( 'paginate' => true, 'items_per_page' => 50 ) );

// Get all notifications of the user ID 21.
Notific::getNotificationCount( 21 );
Notific::getNotificationCount( 21, 'all' );

// Get only the 'unread' notifications of the user ID 21.
Notific::getNotificationCount( 21, 'unread' );

// Get only the 'read' notifications of the user ID 21.
Notific::getNotificationCount( 21, 'read' );

// Mark all the notifications as 'read' for the user with ID 21.
Notific::markNotificationRead( 21 );

// Mark notification number 56 as 'read' for the user with ID 21.
Notific::markNotificationRead( 21, 56 );

// Unserialize if serialized.
Notific::maybeUnserialize( $string );
bash
php artisan vendor:publish --tag=notific
bash
php artisan migrate