Skip to content

Instantly share code, notes, and snippets.

@tomnagengast
Created August 9, 2017 18:39
Show Gist options
  • Save tomnagengast/f444cd4a1920e45805f4830141c76239 to your computer and use it in GitHub Desktop.
Save tomnagengast/f444cd4a1920e45805f4830141c76239 to your computer and use it in GitHub Desktop.
post.update(request().all())
// Ability to detect if a certain attribute was changed after a model was updated
if (post.wasChanged('is_published') && post.is_published) {
Notification.send($subscriber, new NewPostNotification)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment