Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pyaesoneaungrgn/snippet-error-noti
Notify Laravel errors to Slack with a clean UI and include a code snippet.
https://github.com/pyaesoneaungrgn/snippet-error-noti
laravel slack snippet snippet-error-noti
Last synced: 3 months ago
JSON representation
Notify Laravel errors to Slack with a clean UI and include a code snippet.
- Host: GitHub
- URL: https://github.com/pyaesoneaungrgn/snippet-error-noti
- Owner: PyaeSoneAungRgn
- License: mit
- Created: 2023-12-08T19:37:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-29T23:03:48.000Z (9 months ago)
- Last Synced: 2024-04-30T00:23:41.463Z (9 months ago)
- Topics: laravel, slack, snippet, snippet-error-noti
- Language: PHP
- Homepage:
- Size: 40 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
![Snippet Error Noti](https://repository-images.githubusercontent.com/729276965/f357d0c9-69ee-4632-88ae-e77cac7fbd79)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PyaeSoneAungRgn/snippet-error-noti/run-tests.yml?branch=main&label=test)](https://github.com/PyaeSoneAungRgn/snippet-error-noti/actions/workflows/run-tests.yml)
[![Packagist Version](https://img.shields.io/packagist/v/pyaesoneaung/snippet-error-noti)](https://packagist.org/packages/pyaesoneaung/snippet-error-noti)# Snippet Error Noti
Notify Laravel errors to Slack with a clean UI and include a code snippet.
## Installation
```bash
composer require pyaesoneaung/snippet-error-noti
```.env
```
SNIPPET_ERROR_NOTI_ENABLE=true
SNIPPET_ERROR_NOTI_WEBHOOK=slack-webhook-url
```
You can learn how to obtain a webhook URL in the [Slack API documentation](https://api.slack.com/messaging/webhooks). Under the hood, [spatie/laravel-slack-alerts](https://github.com/spatie/laravel-slack-alerts) is utilized to communicate with Slack.## Usage
Enable the capture of exceptions for reporting to Slack by implementing the following change in your `app/Exceptions/Handler.php` file.
```php
use SnippetErrorNoti;
use Throwable;public function register(): void
{
$this->reportable(function (Throwable $e) {
SnippetErrorNoti::captureException($e);
});
}
```## Testing
```bash
composer test
```