PHPackages                             tetra7/laravel-error-issue-creator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. tetra7/laravel-error-issue-creator

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

tetra7/laravel-error-issue-creator
==================================

Automatically creates or updates a GitHub issue for every HTTP 500 error in production.

1.0.1(10mo ago)05MITPHPPHP ^7.4|^8.0

Since Jul 10Pushed 10mo agoCompare

[ Source](https://github.com/tetra-7/laravel-error-issue-creator)[ Packagist](https://packagist.org/packages/tetra7/laravel-error-issue-creator)[ RSS](/packages/tetra7-laravel-error-issue-creator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Laravel Error Issue Creator
===========================

[](#laravel-error-issue-creator)

A Laravel package by **Tetra 7** that automatically opens a GitHub issue whenever an HTTP 500 error occurs in production, then prevents duplicate issues by tracking occurrences and updating the same issue.

Features
--------

[](#features)

- **Auto-discovery**: ServiceProvider is registered automatically by Laravel.
- **HTTP 500 interception**: Hooks into the exception handler to catch server errors.
- **GitHub integration**: Uses the GitHub API to create issues or add comments.
- **Deduplication**: Only one issue per unique error; subsequent occurrences post comments with a counter.
- **Configurable**: Customize token, repository, labels, cache TTL via published configuration.

Requirements
------------

[](#requirements)

- PHP ^7.4 or ^8.0
- Laravel ^8.0, ^9.0, ^10.0, ^11.0 or ^12.0
- A GitHub Personal Access Token with **issues: read &amp; write** permission

Installation
------------

[](#installation)

Install via Composer:

```
composer require tetra7/laravel-error-issue-creator
```

> Once your package is published on Packagist under `tetra7/laravel-error-issue-creator`, you can remove any local path repository entries in your `composer.json`.

Configuration
-------------

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish \
    --provider="Tetra7\ErrorIssueCreator\ErrorIssueServiceProvider" \
    --tag=config
```

Edit `config/error-issue-creator.php` as needed:

```
return [

    // GitHub personal access token (scope: issues: read & write)
    'github_token'    => env('GITHUB_TOKEN'),

    // GitHub repository (format: owner/repository)
    'repository'      => env('GITHUB_REPO'),

    // Labels to apply on new issues
    // Provide a comma-separated list in .env, e.g. "bug,production-error"
    'labels'          => explode(',', env('GITHUB_LABELS', 'bug')),

    // Cache TTL in seconds to prevent duplicate issues
    'cache_ttl'       => env('ERROR_ISSUE_CACHE_TTL', 3600),

];
```

Add the following to your `.env`:

```
GITHUB_TOKEN=ghp_xxx...
GITHUB_REPO=your-org/your-repo
GITHUB_LABELS=bug,production-error,high-priority
ERROR_ISSUE_CACHE_TTL=3600
APP_ENV=production
```

Usage
-----

[](#usage)

1. **Production mode** (`APP_ENV=production`): Any HTTP 500 error triggers the package.
2. **First occurrence**: Opens a new GitHub issue titled

    ```
    [500] Error message…

    ```

    with the configured labels.
3. **Subsequent occurrences** within the cache TTL: Adds a comment on the existing issue, updating the occurrence count.

Testing in Development
----------------------

[](#testing-in-development)

Define a test route that throws a consistent exception:

```
// routes/web.php

Route::get('/test-error-dup', function () {
    throw new Exception('Fixed error for dedupe test');
});
```

Hit `/test-error-dup` multiple times (within the TTL). You should see:

- **First request**: one issue created.
- **Next requests**: comments appended to that same issue, with increasing counters.

Advanced Customization
----------------------

[](#advanced-customization)

- **Labels**: controlled by the `GITHUB_LABELS` env variable.
- **Cache duration**: override `ERROR_ISSUE_CACHE_TTL` (in seconds).
- **Error filter**: modify `ErrorIssueServiceProvider` to catch other exception types or additional HTTP status codes by adding a `monitor_statuses` config option.

Troubleshooting
---------------

[](#troubleshooting)

- **No issues created**:

    - Verify `APP_ENV=production`.
    - Confirm your Personal Access Token has **issues: read &amp; write** scopes.
    - Make sure you’ve published and edited the package config.
- **Multiple issues for the same error**:

    - Ensure the exception message, file, and line remain identical on each occurrence.
    - Check your `cache_ttl` hasn’t expired between requests.
- **No 404/403 logging** (if you’ve added those statuses):

    - Laravel by default doesn’t report HTTP exceptions. Either remove `HttpExceptionInterface` from your app’s `$dontReport`, or switch your package’s callback from `reportable()` to `renderable()` so it fires for 404s.
- **Queue issues**:

    - By default, the package uses `QUEUE_CONNECTION=sync`.
    - For asynchronous processing, set `QUEUE_CONNECTION=database` or `redis` and run a worker:

        ```
        php artisan queue:work
        ```

Contributing
------------

[](#contributing)

Pull requests welcome! Please adhere to PSR-12 coding standards, write tests for new features, and update this README if you change any behavior.

License
-------

[](#license)

This package is open-sourced under the [MIT License](LICENSE).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance55

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

300d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8208bcd7c50d26c8bcf6ef26cb9007f7405d8c71362dcc8ecea64870a1ad9ad3?d=identicon)[dhippo](/maintainers/dhippo)

---

Top Contributors

[![dhippo](https://avatars.githubusercontent.com/u/29350147?v=4)](https://github.com/dhippo "dhippo (4 commits)")

### Embed Badge

![Health badge](/badges/tetra7-laravel-error-issue-creator/health.svg)

```
[![Health](https://phpackages.com/badges/tetra7-laravel-error-issue-creator/health.svg)](https://phpackages.com/packages/tetra7-laravel-error-issue-creator)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[beyondcode/laravel-server-timing

Add Server-Timing header information from within your Laravel apps.

5712.0M1](/packages/beyondcode-laravel-server-timing)[rollbar/rollbar-laravel

Rollbar error monitoring integration for Laravel projects

14110.4M7](/packages/rollbar-rollbar-laravel)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
