mahmoud-mhamed / laravel-slack-errors-log
This is my package laravel-slack-errors-log
0.0.6
2025-08-28 22:01 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- dev-main
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-6
- dev-dependabot/github_actions/dependabot/fetch-metadata-2.4.0
- dev-dependabot/github_actions/ramsey/composer-install-3
- dev-dependabot/github_actions/aglipanci/laravel-pint-action-2.3.1
- dev-dependabot/github_actions/actions/checkout-5
This package is auto-updated.
Last update: 2025-09-02 06:06:54 UTC
README
This package can quickly send alerts to Slack. You can use this to notify yourself of any error.
Installation
You can install the package via composer:
composer require mahmoud-mhamed/laravel-slack-errors-log
You can publish the config file with:
php artisan vendor:publish --tag="laravel-slack-errors-log-config"
This is the contents of the published config file:
return [ 'log_error_in_local' => env('SLACK_LOG_ERROR_IN_LOCAL', false), 'log_header' => env('SLACK_LOG_HEADER', true), 'header_title' => null, // null = 🚨 env('APP_NAME') Exception Occurred! 'log_content' => env('SLACK_LOG_CONTENT', true), 'content' => null, //null = send error message 'log_url' => env('SLACK_LOG_URL', true), 'log_auth' => env('SLACK_LOG_AUTH', true), 'log_trace' => env('SLACK_LOG_TRACE', false), 'append_message' => null,//string data append to slack log message ];
Create New Webhook URL
to create webhook read doc in https://api.slack.com/messaging/webhooks
Usage
in .env file add LOG_SLACK_WEBHOOK_URL="https://hooks.slack.com/services/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"
in App\Exceptions\Handler.php in register function add
use Mahmoudmhamed\LaravelSlackErrorsLog\LaravelSlackErrorsLog; $this->reportable(function (Throwable $e) { LaravelSlackErrorsLog::sendSlackError($e); });
Credits
License
The MIT License (MIT). Please see License File for more information.