PHP code example of caiquebispo / notification-bell
1. Go to this page and download the library: Download caiquebispo/notification-bell 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/ */
caiquebispo / notification-bell example snippets
use CaiqueBispo\NotificationBell\Traits\HasNotifications;
class User extends Authenticatable
{
use HasNotifications;
}
'theme' => [
'mode' => 'auto', // auto | system | dark | light (see below)
'primary' => '#8b5cf6', // any CSS color, or names like 'violet'
'badge_background' => '#ef4444',
'badge_text' => '#ffffff',
'badge_style' => 'count', // count | dot | pulse
'badge_position' => 'top-right', // top-right | top-left | bottom-right | bottom-left
'radius' => '0.75rem',
'dropdown_width' => '22rem',
'toast_position' => 'bottom-right',// + top-left, top-center, bottom-center...
'bell_icon' => null, // Blade view with your own SVG
'item_view' => null, // Blade view to render each list item
],
use CaiqueBispo\NotificationBell\Events\NotificationCreated;
use CaiqueBispo\NotificationBell\Events\NotificationRead;
use CaiqueBispo\NotificationBell\Events\NotificationArchived;
use CaiqueBispo\NotificationBell\Events\NotificationDeleted;
Event::listen(NotificationCreated::class, function ($event) {
// e.g. mirror to e-mail or Slack
$event->notification;
});