ylsideas/subscribable-notifications
Laravel package for subscribable notifications: users opt in or out of notification types, subscriptions are stored in the database, and notifications go only to subscribed users through customizable, queueable channels with per-user preferences and easy integration.
Architecture fit: ylsideas/subscribable-notifications is a thin domain layer over Laravel's native notification system. It adds a Subscribable trait so models (typically User) can opt in/out of named notification types, plus the query/resolution logic that your notification classes consult before dispatching. That is a good architectural fit for any Laravel app already using the built-in Notifiable trait — it occupies a narrow seam rather than replacing the notification pipeline, so it does not force a rewrite of existing Notification classes or queue configuration.
Integration feasibility: High. Adoption is trait-based and additive: add the trait, publish/run the migration for the subscription state table, then guard via() or toMail()/toDatabase() on the subscription check. Effort is measured in hours for a small team, not sprints. The main integration work is not the package itself but the product decision of which notification types become user-controllable, and wiring a preferences UI (settings screen, API endpoint, or unsubscribe links).
Technical risk: Low-to-moderate. The package is small, single-maintainer (ylsideas), and the release cadence is sparse — v1.8.0 appears to be a compatibility-only bump. Risks worth naming:
Key questions:
composer.json diff for the illuminate/* and php constraints — a raise of the PHP floor is the most likely hidden breaking change.database/migrations directory diff before running php artisan migrate in production.Notification::route(...)) and to queued notifications, or only to Notifiable models? Coverage gaps become production incidents.Stack fit: Assumes a conventional Laravel app on PHP 8.2+ with database-backed queues and the default Notifiable user model. No new infrastructure, no external service, no additional runtime dependency beyond the package. Works alongside existing notification channels (mail, database, broadcast, sms via third-party channels) without intercepting them.
Migration path: Purely additive; there is no migration from anything. Sequence: (1) composer require ylsideas/subscribable-notifications on a branch, (2) publish config and migrations, (3) run migrations in a staging environment and inspect the generated schema, (4) apply the trait to User, (5) add subscription checks to one low-risk notification class, (6) ship behind a feature flag with a preferences UI.
Rollback is clean: remove the trait usage and the guards, leave the table in place (harmless), drop the dependency. No data loss risk beyond the subscription preferences themselves, which are regenerable.
Compatibility: The v1.8.0 release is explicitly a Laravel 13 compatibility change. Confirm our target framework version against the package's declared constraints before committing; if we are still on Laravel 11 or 12, verify those versions remain in the illuminate/support constraint range rather than assuming v1.8.0 is a strict superset. Also verify the package's PHP floor matches our runtime — a Laravel 13 bump frequently coincides with a PHP 8.3+ floor.
Sequencing:
composer.json and migration diffs between v1.7.0 and v1.8.0, confirm constraint compatibility.User, staging only.Maintenance: Low ongoing effort in steady state — the package is small and changes rarely. The recurring cost is the annual Laravel major-version treadmill: budget a half-day per Laravel major to bump the package, and accept that the package's compatibility release may lag the framework by weeks. Pin the package version explicitly and treat upgrades as deliberate, reviewed changes rather than running composer update freely.
Support: No commercial support; upstream is GitHub issues on a single-maintainer repo. Internal ownership should sit with the team that owns the notification/preferences domain, and that team should be capable of reading ~a few hundred lines of PHP to patch or fork. Given the small surface, a fork is a reasonable contingency and should be pre-agreed as the escalation path rather than discovered mid-incident.
Scaling: Negligible performance impact — one trait method and a lookup against a small per-user subscription table, typically resolved per notification dispatch. Watch two things at scale: (a) if subscription checks run per-recipient inside bulk/digest sends, ensure the lookup is eager-loaded or cached rather than N+1 against the database; (b) for high-volume digest jobs, cache subscription state per user per batch. Neither is a blocker for typical volumes.
Failure modes:
composer update resolves to an incompatible tree. Prevented by reading constraints before upgrading and pinning in composer.json.Ramp-up: Very shallow. A mid-level Laravel developer is productive in under a day; the concepts (trait, Notifiable, notification channels) are core Laravel, not package-specific. The genuine ramp-up cost is on the product side: deciding the notification taxonomy, defaults, and which categories are user-controllable versus mandatory. That conversation takes longer than the code and should be sequenced first — it determines the data model defaults and the settings UI, and getting it wrong means re-migrating user preferences later.
How can I help you explore Laravel packages today?