When you have an laravel application with many users & get report frequently about error. So in that case you have to check the logs mannully and fix the issues of user. But before get a complain from user you have the opportunity to know where issue/error triggerd, that would be great. WSo i will help you to know when any error trigger on your application, the error log automatically send to your slack channel.

Step 1 : Create a webhook URL on slack

For this you need to gohttps://api.slack.com/and select create an app option. Please enter your app name (anything) and select the slack workspace.

Step 2 : Select Incoming webhook and Turn on

Turn on the slack webhook service and you will get option below the page to add your app into channel where you want to get the notication.

Step 3 : Test the webhook URL

Now you will get a webhook url and CURL command to test. So before setup into laravel you can copy the curl code and paste into Termial to check.

Step 4 : setup .env

Just go into your laravel project and setup the .env files like this.

Step 4 : Test from your application

This time, you can produce a error, then you will see that application automatically send the error logs to your slack.