Posts

Showing posts from April, 2023

Send Laravel Log to Slack Notification

Image
Laravel provides robust logging services that allow you to log messages to Slack to notify your entire team. There are  two main  and very easy  steps  to prepare Slack and Laravel to connect with each other. Step 1- Slack Part: In slack dashboard go to:  Administration / Manage apps Then in the Slack search box type :  Incoming WebHooks Then you will see the Slack  Incoming WebHooks   app information page: Press the button of  Add to Slack. In the new window it will ask you to select one of your  slack channels  and then press  Add Incoming WebHooks Integration. Then a new window will show you the WebHooks URL: At the end of this page you see the button of  Save Settings.  Press it to save. Copy the WebHooks URL We need to set it in Laravel .env file. As soon as the WebHooks url is generated you will see a notice inside the channel you selected like below: Step 2- Laravel Part: Now put this line in Laravel .env file LOG_SLACK_WEBHOOK_URL =WebHooks-URL In Laravel 6 the config file of