mgilet/notification-bundle
Symfony bundle that adds a flexible notification system to your app. Attach notifications to any entity via a trait and interface, create and manage them with a service, and display lists and unread counts through built-in controllers and Twig helpers.
Framework reality check up front: despite being filed under "Laravel/PHP," this is a Symfony bundle, not a Laravel package — and 4.0 does not change that. It will not drop into a Laravel app. It is useful to a PM as (a) a build-vs-buy input for a legacy Symfony codebase, or (b) a reference design for what a notification inbox needs. Every decision below assumes one of those two framings.
Notifiable trait and database notification channel, which is maintained, documented, and already in your dependency tree.Adopt (vendor, don't just install) when:
mgilet_notification.notification_class rather than Doctrine resolve_target_entities, and NotificationManager::createNotification now returns your custom class instead of a base entity — which removes the type-juggling most teams would otherwise write around.Look elsewhere when:
Migration cost if you already run 3.x: 4.0 is a breaking change for anyone using a custom Notification entity. You must remove the resolve_target_entities Doctrine directive and add config/packages/mgilet_notification.yaml with notification_class. Small in isolation, but plan it rather than absorbing it — and if you followed the earlier advice and forked, this is a rebase you have to schedule.
Decision rule: if you are not on Symfony 3, do not adopt — read the source for schema ideas and move on. If you are on Symfony 3, treat it as a starting point to fork, not a dependency to trust. If you already forked on 3.x, take 4.0's custom-entity fix and HTML fix as patch material, and re-check your sanitization assumptions before enabling HTML output.
To executives: This is a small MIT-licensed Symfony library that provides a user notification inbox out of the box — the database model, read/unread tracking, and the service layer to create and fetch notifications. It removes an estimated one to two weeks of backend work and lets us spend that time on the inbox UI and on the notification content itself, which is where users actually form an opinion. Version 4.0 shipped recently with two community bug fixes, including a long-standing HTML-rendering defect, and a cleaner way to plug in our own notification entity — modest but real evidence the project is not dead. The honest caveats remain: it applies only if we stay on Symfony 3, it is still a single-maintainer project with a long release gap and no downstream projects depending on it, and 4.0 is a breaking change for anyone already using a custom entity. My recommendation is unchanged: treat it as a fork we own, or as a reference design if we are on Laravel or a newer Symfony, where the platform already gives us this capability for free.
To engineering: Do not install-and-forget. Vendor or fork it, pin the version, audit the Doctrine schema and service definitions, and add tests around the notification manager — especially seen/unread transitions and deletion, which is where inbox bugs surface. If you are upgrading from 3.x with a custom entity, budget for the 4.0 migration: drop resolve_target_entities from Doctrine config, add mgilet_notification.yaml with notification_class, and verify createNotification now returns your entity (that fix is the reason to upgrade, but confirm your type hints and factories agree). Separately, treat the re-enabled HTML rendering as a security review item, not a changelog line: confirm notification bodies are sanitized or that only trusted content reaches the renderer. Accept that you own the upgrade path for as long as the feature lives. The counter-proposal is to write our own entity, repository, service, and endpoint: a few hundred lines, more upfront effort, but fully ours and consistent with our conventions and framework version.
To design/product: The bundle's data model is a useful forcing function — it makes us answer whether read and dismissed are the same thing, whether notifications expire, and whether the inbox is global or per-category. 4.0 restores rich HTML in the notification list, which is a design opportunity (links, formatting, richer actions) and a content-governance question (who is allowed to author markup in a notification). Prototype the UX against it before we commit to building or buying anything heavier.
How can I help you explore Laravel packages today?