PHPackages                             ips-laravel/huntglitch - 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. ips-laravel/huntglitch

ActiveLibrary

ips-laravel/huntglitch
======================

Huntglitch package for the Laravel

1.0.5(7mo ago)213MITPHPPHP ^8.0

Since Aug 11Pushed 7mo agoCompare

[ Source](https://github.com/huntglitch-npm/HuntGlitch-laravel)[ Packagist](https://packagist.org/packages/ips-laravel/huntglitch)[ RSS](/packages/ips-laravel-huntglitch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

Huntglitch - Laravel Error &amp; Query Logger Package
=====================================================

[](#huntglitch---laravel-error--query-logger-package)

**Huntglitch** is a development monitoring platform that can help you instantly solve bugs, broken codes and avoid crashes and false API calls with ease. Huntglitch gives you answers, not hints.

You can use Huntglitch to find out any errors or bugs in the critical codes of your app or software, quickly find out bugs, prevent lags due to rising user requests by forecasting future demand and quickly monitor the overall health of your app or software with ease.

 [\#Logging](https://packagist.org/search/?tags=logging) [\#Debugging](https://packagist.org/search/?tags=debugging) [\#Laravel](https://packagist.org/search/?tags=laravel) [\#PHP](https://packagist.org/search/?tags=php) [\#Monitoring](https://packagist.org/search/?tags=monitoring) [\#QueryLogger](https://packagist.org/search/?tags=query-logger)

Documentation
-------------

[](#documentation)

- [Features](#features)
- [Supported Versions](#supported-versions)
- [Installation](#installation)
- [Environment Configuration](#environment-configuration)
- [Usage](#usage-in-laravel)
- [Methods](#methods-overview)
- [FAQs](#faqs)
- [Contributing](#contributing)
- [Security Vulnerabilities](#security-vulnerabilities)
- [License](#license)
- [Contributing](#contributing)
- [Support](#get-support)

Getting Started with Huntglitch
-------------------------------

[](#getting-started-with-huntglitch)

Before implementing the package, please complete these setup steps:

1. **Register an Account**
    Sign up for a free Huntglitch account here:
2. **Create a Project**
    Once registered, create a new project here:
3. **Follow the Installation &amp; Implementation Guide**
    Implement this package in your Laravel application by following the steps in the [Installation](#installation) and [Usage in Laravel](#usage-in-laravel) sections of this README.
4. **View Your Logs &amp; Error Reports**
    After the integration is complete and your application starts generating logs, you can view all errors, warnings, and queries in your Huntglitch dashboard:
     → Select your project to view detailed logs.

Features
--------

[](#features)

- Automatic logging of exceptions and errors
- Track and store MySQL query logs
- Integrate easily with Laravel exception handler
- PSR-4 autoloading support
- Laravel vendor publish support for easy config
- Built-in support for tagging logs with severity levels

Supported Versions
------------------

[](#supported-versions)

- **PHP**: ^8.0
- **Laravel**: ^9.0 | ^10.0 | ^11.0 | ^12.0

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

[](#installation)

Run the following command to install the package via Composer:

```
composer require ips-laravel/huntglitch
```

Environment Variables
---------------------

[](#environment-variables)

Add these variables to your `.env` file:

```
HUNTGLITCH_PROJECT_ID={your-project-id}
HUNTGLITCH_DELIVERABLE_ID={your-deliverable-id}
HUNTGLITCH_LOG_ENDPOINT=https://api.huntglitch.com/
HUNTGLITCH_JS_DOMAIN=example.com,anotherdomain.com,sub.site.com
```

Then publish the Huntglitch config file:

```
php artisan vendor:publish --provider="Itpath\Huntglitch\HuntglitchServiceProvider" --tag=config
```

This will create `config/huntglitch.php` in your app. The package will automatically use these values from your `.env` file—no need to edit `config/app.php`.

Usage in Laravel
----------------

[](#usage-in-laravel)

### ➤ Basic Usage in a try-catch block

[](#-basic-usage-in-a-try-catch-block)

```
use Itpath\Huntglitch\Huntglitch;

try {
    echo 100 / 0;
} catch (Throwable $e) {
    $glitch = new Huntglitch();
    $glitch->add($e);
}
```

### ➤ Global Usage for Exception Logging

[](#-global-usage-for-exception-logging)

#### **For Laravel 9, 10, and 11** (`Handler.php` method)

[](#for-laravel-9-10-and-11-handlerphp-method)

Update the `register()` method in `app/Exceptions/Handler.php`:

```
use Itpath\Huntglitch\Huntglitch;

public function register()
{
    $this->reportable(function (Throwable $e) {
        $glitch = new Huntglitch();
        $glitch->add($e);
    });
}
```

#### **For Laravel 12** (`bootstrap/app.php` method)

[](#for-laravel-12-bootstrapappphp-method)

In Laravel 12, the `Handler.php` file is no longer used for exception handling.
Instead, open `bootstrap/app.php` and add the following inside the **exception configuration** section:

```
use Illuminate\Foundation\Configuration\Exceptions;
use Itpath\Huntglitch\Huntglitch;

->withExceptions(function (Exceptions $exceptions): void {
    $exceptions->report(function (\Throwable $e) {
        $glitch = new Huntglitch();
        $glitch->add($e);
    });
})
->create();
```

JavaScript Frontend Error Logging
---------------------------------

[](#javascript-frontend-error-logging)

You can send frontend (browser) errors directly to Huntglitch using the built-in JS log route. This allows you to collect logs from your website or web app without any backend code changes.

### How it works

[](#how-it-works)

- The package automatically registers a POST route at `/huntglitch/js-log`.
- You can use the provided JS snippet or your own error collector to send logs to this endpoint.
- The route will only accept requests from allowed domains (see below).

### Setup

[](#setup)

1. **Configure Allowed Domains**

    In your `.env` file, add:

    ```
    HUNTGLITCH_JS_DOMAIN=example.com,anotherdomain.com,sub.site.com
    ```

    This will restrict log submissions to only those domains. Use a comma to separate multiple domains.
2. **Include the JS Collector**

    Add the following script to your HTML:

    ```

        HuntGlitchAutoInit('ADD_YOUR_BACKEND_URL/huntglitch/js-log');

    ```

    Replace `ADD_YOUR_BACKEND_URL` with your backaend laravel URL. No need to change for `/huntglitch/js-log` as it's default laravel route from HuntGlitch.
3. **Frontend JS Example**

    The JS collector will automatically capture errors and send them to your Laravel backend:

    ```
    window.HuntGlitchAutoInit = function(url) {
        HuntGlitch.init({
            endpoint: url,
            captureConsole: true,
            batchSize: 1,
            // ...other options
        });
    };
    // See huntglitch.js for full options and customization
    ```

### What gets sent

[](#what-gets-sent)

- The JS collector sends error details, stack trace, file, line, and browser info.
- The Laravel package automatically adds your Huntglitch project and deliverable IDs to each log.

### Security

[](#security)

- Only requests from allowed domains (as set in `HUNTGLITCH_JS_DOMAIN`) will be accepted.
- Requests from other domains will be rejected with a 403 error.

---

Methods Overview
----------------

[](#methods-overview)

### `add($exception, $type = 'error', $additionalData = [])`

[](#addexception-type--error-additionaldata--)

- Logs a message or exception
- Optional second parameter sets severity (e.g., `debug`, `info`, `warning`, `error`)
- Third optional parameter is an array for custom context data

### Predefined Logging Methods

[](#predefined-logging-methods)

You can also use:

```
addError($e, $data);
addWarning($e, $data);
addInfo($e, $data);
addDebug($e, $data);
addNotice($e, $data);
```

All these methods accept:

- `string|Throwable $e`
- `array $data (optional)`

**FAQs**
--------

[](#faqs)

### 1. What does this package do?

[](#1-what-does-this-package-do)

The **Huntglitch** package provides an **Error &amp; Query Logger Package** to monitor **errors, warning, info and debug** of Laravel applications.

### 2. How do I install the package?

[](#2-how-do-i-install-the-package)

Run the following command in your terminal:

```
composer require ips-laravel/huntglitch
```

### 3. Which Laravel versions are supported?

[](#3-which-laravel-versions-are-supported)

This package supports **Laravel 9, 10, 11, and 12** with **PHP 8+** compatibility.

### 4. How do I update the package to the latest version?

[](#4-how-do-i-update-the-package-to-the-latest-version)

Run the following command to update:

```
composer update ips-laravel/huntglitch
```

### 5. Can I contribute to this package?

[](#5-can-i-contribute-to-this-package)

Absolutely! Contributions are welcome. See the [CONTRIBUTING](https://github.com/huntglitch-npm/HuntGlitch-laravel/blob/main/CONTRIBUTING.md) guidelines for details.

### 6. Where can I get support?

[](#6-where-can-i-get-support)

For any support or queries, feel free to [contact us](mailto:support@huntglitch.com).

**Contributing**
----------------

[](#contributing)

We welcome contributions from the community! Feel free to **Fork** the repository and contribute to this module. You can also create a pull request, and we will merge your changes into the main branch. See [CONTRIBUTING](https://github.com/huntglitch-npm/HuntGlitch-laravel/blob/main/CONTRIBUTING.md) for details.

**Security Vulnerabilities**
----------------------------

[](#security-vulnerabilities)

Please review our [Security Policy](https://github.com/huntglitch-npm/HuntGlitch-laravel/security/policy) on how to report security vulnerabilities.

**License**
-----------

[](#license)

This package is open-source and available under the MIT License. See the [LICENSE](https://github.com/huntglitch-npm/HuntGlitch-laravel/blob/main/LICENSE) file for details.

**Get Support**
---------------

[](#get-support)

- Feel free to [contact us](mailto:support@huntglitch.com) if you have any questions.
- If you find this project helpful, please give us a ⭐ [Star](https://github.com/huntglitch-npm/HuntGlitch-laravel/stargazers).

**You may also find our other useful packages:**
------------------------------------------------

[](#you-may-also-find-our-other-useful-packages)

- [MySQL Info Package](https://packagist.org/packages/itpathsolutions/mysqlinfo)
- [PHP Info Package](https://packagist.org/packages/itpathsolutions/phpinfo)
- [Role Wise Session Manager Package](https://packagist.org/packages/itpathsolutions/role-wise-session-manager)
- [Authinfo - User Login Tracker](https://packagist.org/packages/itpathsolutions/authinfo)
- [Chatbot Package](https://packagist.org/packages/itpathsolutions/chatbot)
- [Redis Package](https://packagist.org/packages/itpathsolutions/redisinfo)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance63

Regular maintenance activity

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~10 days

Total

6

Last Release

224d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c3d05a9de26151bb2830a26d4fe6f8d98c00580897c4f9e7d9251ab10ea9cfd?d=identicon)[huntglitch](/maintainers/huntglitch)

---

Top Contributors

[![saurabh-itpathsolutions](https://avatars.githubusercontent.com/u/106726491?v=4)](https://github.com/saurabh-itpathsolutions "saurabh-itpathsolutions (17 commits)")[![renoschubert](https://avatars.githubusercontent.com/u/46114615?v=4)](https://github.com/renoschubert "renoschubert (16 commits)")[![vidhi-nirmal71](https://avatars.githubusercontent.com/u/125467384?v=4)](https://github.com/vidhi-nirmal71 "vidhi-nirmal71 (1 commits)")

---

Tags

phplaravelitpathsolutionshuntglitch

### Embed Badge

![Health badge](/badges/ips-laravel-huntglitch/health.svg)

```
[![Health](https://phpackages.com/badges/ips-laravel-huntglitch/health.svg)](https://phpackages.com/packages/ips-laravel-huntglitch)
```

###  Alternatives

[laracraft-tech/laravel-xhprof

Easy XHProf setup to profile your laravel application!

235321.4k](/packages/laracraft-tech-laravel-xhprof)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[kompo/kompo

Laravel &amp; Vue.js FullStack Components for Rapid Application Development

11812.4k21](/packages/kompo-kompo)[bavix/laravel-xhprof

Quick profiling of your code for Laravel

22156.6k](/packages/bavix-laravel-xhprof)

PHPackages © 2026

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