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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners