If you’ve not been living under a rock in recent years then you’ll probably have heard of Slack, a great tool for collaboration between distributed teams. It comes with lots of useful features, some of which make it a great solution for logging events from your PHP applications. Out of the box, Slack has: You can configure the “Incoming webhooks” app in Slack, follow steps 1–3 in the “Getting Started” section here: The end result should be a URL (that you need to keep secret) that will look something like this: Good practice would suggest you should store this URL somewhere safe, like as an environment file, rather than hard code it or keep it in Version Control. The most basic implementation looks like this: In most instances I use a simple function like the example below.
You can do lots more with this package, such as post links and embed images among other media.