• Reading time ~ 1 min
  • 08.10.2022

Megaphone is a Livewire UI for Laravel-based user notifications. It uses built-in Laravel notification features to allow you to add bell icons to your Livewire app:

use MBarlow\Megaphone\Types\Important;
use App\Models\User;
 
$notification = new Important(
    // Notification Title
    'Expected Downtime!',
    // Notification Body
    'We are expecting some downtime today at around 15:00 UTC for some planned maintenance. Read more on a blog post!',
    'https://example.com/link', // Optional
    'Read More...' // Optional
);
 
$user->notify($notification);

Using the above code, you can render notifications in your app using the provided Blade component:

<livewire:megaphone></livewire:megaphone>

This package has other neat features to manage notifications and send them en masse to users:

  • Custom notification types
  • Command to clear announcements
  • Customizable list of notification types in the admin panel
  • Admin panel to send notifications to all users
  • Livewire component to render the admin panel

You can learn more about this package, get full installation instructions, and view the source code on GitHub.


This package was submitted to our Laravel News Links section. Links is a place the community can post packages and tutorials around the Laravel ecosystem. Follow along on Twitter @LaravelLinks

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297