mikebarlow / megaphone Goto Github PK
View Code? Open in Web Editor NEWLivewire UI for Laravel based user notifications
License: MIT License
Livewire UI for Laravel based user notifications
License: MIT License
The query to select old, read notifications from the database in the console command doesn't merge in custom types.
I have been getting this error in production but not in localhost.
Livewire: Multiple root elements detected. This is not supported. See docs for more information https://laravel-livewire.com/docs/2.x/troubleshooting#root-element-issues
Link to the demo example app
Please add a feature to allow all visitors to be notified, whether or not they are logged in.
Hello,
thank you for this great package, I'm having a lot of fun in my project using it.
My project has teams and users belonging to teams. Both the Team model and User model can be Notifiable.
I'd like to know if there is a way to display at the same time notifications for the current user and for the team the current user belongs to.
I've seen that a notifiableId parameter can be passed to the megaphone component but it's either the user or the team. Plus that would need to adjust the model property in the config file.
What would be the strategy to achieve the described behavior? Thank you for your input on this matter!
megaphone/src/Livewire/Megaphone.php
Line 11 in e0eb259
currently $user is a public variable and the user-model with all related models is serialized as json and visible for the user client side. This can be a major security issue. As far as I see $user is not used in the components templates so could you please change this to
class Megaphone extends Component
{
private $user;
...
this would solve the problem.
thx
Readme doesn't mention that AlpineJS is required.
I'm using laravel 8. I got this error after install megaphone.
Symfony\Component\ErrorHandler\Error\FatalError
Cannot use ::class with dynamic class name
Used in a few sections, drop down, rules etc...
It simply loads from 'megaphone.types' rather than merging in correctly with custom types.
Reuse tested function within HasMegaphone trait
Only used when dropped into a non-tailwind project, but would still make life easier.
Something like @megaphoneStyles
<link rel="stylesheet" href="{{ asset('vendor/megaphone/css/announcements.css') }}">
Should actually be
<link rel="stylesheet" href="{{ asset('vendor/megaphone/css/megaphone.css') }}">
Kindly add a button to all unread notifications as read, like mark all as read.
To mark a notification as read it currently uses a "mouseenter" event on the notification within the popout.
This sometimes causes a problem when you open the popout and the mouse is already then hovering the notification and it instantly marks it as read.
Need to add some kind of debounce to prevent the notification from becoming instantly read.
Checkout this package:
https://github.com/wireui/heroicons
It's an icon set library (decoupled from it's parent package, WireUI), I am thinking maybe we can replace all the icons in the repo with it so that it would require much less code, be easier to manipulate and be more consistent all round.
Eg:
<button role="button" aria-label="close modal" class="focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 rounded-md cursor-pointer" @click="open = false">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 6L6 18" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" />
<path d="M6 6L18 18" stroke="#4B5563" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</button>
To:
<button class="right-0"><x-icon name="x" class="w-6 h-6 text-gray-500" /></button>
I want to make a pull request to do so btw.
Hello,
any plans to update to livewire 3? or does it have a fork with the new version?
Tks
It would be great if we can call a listener or method using pusher events to show real-time notifications without reloading the page
Hey, I'm trying to make an entire page where people can see their notifications, not just from a popout, how do I implement this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.