Category: PHP

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.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners