Skip to content

Conversation

@jeremykenedy
Copy link
Contributor

@jeremykenedy jeremykenedy commented Dec 17, 2025

Added Notifications via websockets.

Can be system, a user (user-specific), or a release. It is made to add more, but those are the boilerplates.

By default, the feature is off, and the current demo notifications show. This is a feature behind a flag, enabled in the .env file.

Reverb docs: https://laravel.com/docs/12.x/reverb

  • Docs outline using beyond the dev environment.

Needed Reverb creds (Obtain with php artisan install:broadcasting):
REVERB_APP_ID=my-app-id
REVERB_APP_KEY=my-app-key
REVERB_APP_SECRET=my-app-secret

APP_NOTIFICATIONS_ENABLED=true
APP_NOTIFICATIONS_IN_DEMO_MODE=true
APP_NOTIFICATIONS_AUTO_CLEANUP_DELETED_ENABLED=false
APP_NOTIFICATIONS_AUTO_CLEANUP_DELETED_DAYS=60
APP_NOTIFICATIONS_AUTO_CLEANUP_SEND_EMAIL=true
APP_NOTIFICATIONS_AUTO_CLEANUP_SEND_EMAIL_TO="${APP_HELP_EMAIL}"

....

Run the reverb server:

php artisan reverb:start

or

php artisan reverb:start --debug

--

  • Added artisan command and scheduled jobs to soft-deleted notifications, send notifications planned, and pre-soft-delete notifications schedule to expire.
php artisan notifications:cleanup-deleted
php artisan notifications:send-scheduled 
php artisan notifications:soft-delete-expired
  • Artisan command and job to clean up unverified users when email verification is enabled.
php artisan users:auto-destroy-run

As a super admin, when you are logged in, you can quickly flood notifications and test the cleanup system. You can put the following into the console in Chrome Dev Tools (Will only work on local as there is middleware to ensure envirionment is local):

fetch('/_test/notify/user', {
  method: 'POST',
  credentials: 'same-origin',
  headers: { 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content },
})

fetch('/_test/notify/system', {
  method: 'POST',
  credentials: 'same-origin',
  headers: { 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content },
})

fetch('/_test/notify/release', {
  method: 'POST',
  credentials: 'same-origin',
  headers: { 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content },
})

fetch('/_test/notifications/cleanup-email', {
  method: 'POST',
  headers: {
    'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ run_cleanup: false }),
})
  .then(r => r.json())
  .then(console.log)
  .catch(console.error)

fetch('/_test/notifications/cleanup-email', {
  method: 'POST',
  headers: {
    'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content,
    'Accept': 'application/json',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ run_cleanup: true }),
})
  .then(r => r.json())
  .then(console.log)
  .catch(console.error)

  • Updated readme for websocket notifications with Reverb.
  • Updated public docs for websocket notifications with Reverb.
  • Will still work without the feature.

ezgif-23a1610d2786227b

jeremykenedy and others added 30 commits December 12, 2025 02:51
…le of user on new users, add xxs and xs breakpoints to xxs: and xs: in classes are available
@jeremykenedy jeremykenedy marked this pull request as ready for review December 18, 2025 11:05
@otatechie otatechie self-assigned this Dec 18, 2025
@otatechie otatechie added the enhancement New feature or request label Dec 18, 2025
@otatechie otatechie merged commit 5996b55 into otatechie:main Dec 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants