PHP code example of inlayphp / notifications

1. Go to this page and download the library: Download inlayphp/notifications 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/ */

    

inlayphp / notifications example snippets


use Inlay\\Notifications\\Notification;

Notification::make('Profile updated.')
    ->body('Your account details are saved.')
    ->success()
    ->action('View profile', route('profile.edit'))
    ->send();

use Inlay\Notifications\NotificationManager;

Notification::make('Import finished')
    ->body('Your users are ready to review.')
    ->success()
    ->sendToDatabase($request->user());

$notifications = app(NotificationManager::class)
    ->databaseNotifications($request->user(), unreadOnly: true);

app(NotificationManager::class)->markDatabaseAsRead(
    $request->user(),
    $notifications[0]['database_id'],
);
bash
php artisan vendor:publish --tag=inlay-notifications-migrations
php artisan migrate