Skip to content

Instantly share code, notes, and snippets.

@greenbicycle
greenbicycle / Slackhandler
Last active August 20, 2018 22:50
Make Laravel use SlackHandler for Logging
/*
I am using Laravel 5.2. This will probably work for many versions, but use at your own risk.
Instructions
- Make sure that you add SLACK_TOKEN, SLACK_CHANNEL, SLACK_USERNAME, SLACK_ICON in .env
- SLACK_ICON - you can use almost any emoji that Slack supports. See http://www.emoji-cheat-sheet.com/
- SLACK_USER - You can use any username you want to. It doesn't have to be an existing user
- SLACK_CHANNEL - I don't know what happens if you use a non-existent channel. I always make sure the channel exists first
- SLACK_TOKEN - You can find this in your Slack account somewhere
- Add the code below to the top of bootstrap/app.php