PHPackages                             hymns/alertiqo-client-php - 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. hymns/alertiqo-client-php

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

hymns/alertiqo-client-php
=========================

Alertiqo - Laravel error tracking package, as simple as possible!

1.0.6(6mo ago)41.5k2MITPHPPHP ^8.0|^8.1|^8.2

Since Dec 12Pushed 6mo agoCompare

[ Source](https://github.com/hymns/alertiqo-client-php)[ Packagist](https://packagist.org/packages/hymns/alertiqo-client-php)[ RSS](/packages/hymns-alertiqo-client-php/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

Alertiqo Client PHP - Laravel Error Tracking
============================================

[](#alertiqo-client-php---laravel-error-tracking)

Error tracking for Laravel - as simple as possible! 🚀

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

[](#installation)

Install via Composer:

```
composer require hymns/alertiqo-client-php
```

Publishable Assets
------------------

[](#publishable-assets)

```
# Publish config file
php artisan vendor:publish --tag=alertiqo-client-config
```

TagDescriptionPath`alertiqo-client-config`Config file`config/alertiqo.php`This will create `config/alertiqo.php` for customization.

Quick Setup (Laravel 9, 10, 11, 12)
-----------------------------------

[](#quick-setup-laravel-9-10-11-12)

**1. Install package:**

```
composer require hymns/alertiqo-client-php
```

**2. Add `.env` config:**

```
ALERTIQO_API_KEY=your-api-key-here
ALERTIQO_ENDPOINT=https://alertiqo.io
```

**That's it!** All exceptions will be automatically tracked.

**3. Test your setup:**

```
php artisan alertiqo:test
```

**Optional - Publish config file:**

```
php artisan vendor:publish --tag=alertiqo-client-config
```

### Queue Configuration (Recommended)

[](#queue-configuration-recommended)

**By default, Alertiqo uses queues** to send error reports asynchronously. This will ensures your app stay fast even when reporting errors.

**Prerequisites:**

- Laravel queue must be configured (Redis, database, etc.)
- Queue worker must be running: `php artisan queue:work`

**Features:**

- ✅ Non-blocking error reporting
- ✅ Automatic retry (3 attempts with exponential backoff)
- ✅ Fallback to sync if queue fails
- ✅ Better performance for production

**Disable queue (not recommended):**

```
ALERTIQO_USE_QUEUE=false
```

This will send reports synchronously, which may slow down responses if the API is down or slow.

### SQL Query Logging

[](#sql-query-logging)

**Automatically capture database queries as breadcrumbs** for easier debugging!

**Enable SQL logging:**

```
ALERTIQO_LOG_SQL=true
ALERTIQO_SQL_THRESHOLD=100  # Only log queries > 100ms (optional)
```

**Features:**

- ✅ Captures SQL, bindings, execution time, and connection name
- ✅ Threshold filtering (e.g., only slow queries)
- ✅ Automatic level detection (warning for queries &gt; 1s)
- ✅ Included as breadcrumbs in error reports

**Example breadcrumb output:**

```
{
  "message": "Database Query",
  "category": "query",
  "level": "info",
  "data": {
    "sql": "SELECT * FROM users WHERE id = ?",
    "bindings": [123],
    "time": "45.2ms",
    "connection": "mysql"
  }
}
```

**Best practices:**

- Use threshold in production to avoid noise
- Set `ALERTIQO_SQL_THRESHOLD=200` to only log slow queries
- Disable in high-traffic apps if too many queries

### Performance Monitoring

[](#performance-monitoring)

**Track slow requests automatically** to catch performance issues before they become errors!

**Enable performance monitoring:**

```
ALERTIQO_PERFORMANCE_MONITORING=true
ALERTIQO_PERFORMANCE_THRESHOLD=1000  # Report requests > 1 second
```

**What gets captured:**

- Request duration (ms)
- Memory usage (MB)
- Peak memory (MB)
- Database query count
- HTTP status code
- Full URL and method

**Features:**

- ✅ Automatic slow request detection
- ✅ Non-intrusive (only reports if threshold exceeded)
- ✅ Includes all breadcrumbs for full context
- ✅ Memory profiling included

### Error Sampling

[](#error-sampling)

**Control error capture rate** for high-traffic applications:

```
ALERTIQO_SAMPLE_RATE=0.1  # Capture 10% of errors
```

**Use cases:**

- **1.0** (100%) - Development/staging
- **0.5** (50%) - Medium traffic production
- **0.1** (10%) - High traffic production
- **0.01** (1%) - Very high traffic

**Smart sampling:**

- Critical errors always captured
- Random sampling for other errors
- Reduces dashboard noise
- Saves bandwidth and storage

Testing Your Setup
------------------

[](#testing-your-setup)

**Artisan Command:**

```
php artisan alertiqo:test
```

This will send a test error to your dashboard. Perfect to verify setup!

**Debug Route (Development Only):**

Add this to `routes/web.php` for quick testing:

```
// Only in development!
if (app()->environment('local')) {
    Route::get('/debug-alertiqo', function () {
        throw new Exception('My first Alertiqo error!');
    });
}
```

Visit `/debug-alertiqo` using web browser, then check your dashboard.

Notifications
-------------

[](#notifications)

**Notifications are configured via the backend dashboard**, not in the package config. This allows centralized management across all your projects.

**Available notification channels:**

- **Slack** - Instant alerts to Slack channels
- **Email** - Send to multiple recipients
- **Webhook** - Custom HTTP webhooks

**Configure via dashboard:**

1. Go to Project Settings → Notifications
2. Add notification channel (Slack/Email/Webhook)
3. Set minimum error level (debug, info, warning, error, critical)
4. Enable/disable as needed

**Benefits:**

- ✅ Centralized config (no need to update every app)
- ✅ Smart throttling (avoid spam)
- ✅ Per-project customization
- ✅ Easy to add/remove channels
- ✅ Notification history &amp; audit log

Usage
-----

[](#usage)

### Automatic Error Tracking

[](#automatic-error-tracking)

This package will automatically track all exceptions in your Laravel app. No additional setup needed!

### Manual Error Capture

[](#manual-error-capture)

#### Using Facade

[](#using-facade)

```
use Alertiqo\Laravel\Facades\Alertiqo;

// Capture exception
try {
    throw new \Exception('Something went wrong');
} catch (\Exception $e) {
    Alertiqo::captureException($e);
}

// Capture message
Alertiqo::captureMessage('User logged in', 'info');

// Add breadcrumb
Alertiqo::addBreadcrumb([
    'message' => 'User clicked button',
    'category' => 'user-action',
    'level' => 'info',
    'data' => ['button_id' => 'submit']
]);

// Set user context
Alertiqo::setUser([
    'id' => auth()->id(),
    'email' => auth()->user()->email,
    'name' => auth()->user()->name,
]);

// Set tags
Alertiqo::setTag('feature', 'checkout');
Alertiqo::setTags([
    'version' => '2.0.0',
    'subscription' => 'premium'
]);
```

#### Using Helper Functions

[](#using-helper-functions)

```
// Capture exception
alertiqo_capture($exception);

// Capture message
alertiqo_message('Payment processed', 'info');

// Add breadcrumb
alertiqo_breadcrumb('User navigated to checkout', 'navigation', 'info');

// Get instance
$client = alertiqo();
$client->setUser(['id' => 123]);
```

### Integration Examples

[](#integration-examples)

#### In Controllers

[](#in-controllers)

```
namespace App\Http\Controllers;

use Alertiqo\Laravel\Facades\Alertiqo;

class OrderController extends Controller
{
    public function store(Request $request)
    {
        Alertiqo::addBreadcrumb([
            'message' => 'Order creation started',
            'category' => 'order',
            'level' => 'info'
        ]);

        try {
            $order = Order::create($request->all());

            Alertiqo::captureMessage('Order created successfully', 'info', [
                'tags' => ['order_id' => $order->id]
            ]);

            return response()->json($order);
        } catch (\Exception $e) {
            Alertiqo::captureException($e, [
                'tags' => ['user_id' => auth()->id()]
            ]);

            return response()->json(['error' => 'Failed to create order'], 500);
        }
    }
}
```

#### In Jobs

[](#in-jobs)

```
namespace App\Jobs;

use Alertiqo\Laravel\Facades\Alertiqo;

class ProcessPayment implements ShouldQueue
{
    public function handle()
    {
        Alertiqo::addBreadcrumb([
            'message' => 'Payment processing started',
            'category' => 'job',
            'level' => 'info'
        ]);

        try {
            // Process payment logic
        } catch (\Exception $e) {
            Alertiqo::captureException($e);
            throw $e;
        }
    }
}
```

#### In Event Listeners

[](#in-event-listeners)

```
namespace App\Listeners;

use Alertiqo\Laravel\Facades\Alertiqo;

class SendWelcomeEmail
{
    public function handle($event)
    {
        try {
            // Send email logic
        } catch (\Exception $e) {
            Alertiqo::captureException($e, [
                'tags' => ['event' => 'user_registered']
            ]);
        }
    }
}
```

#### In Middleware

[](#in-middleware)

```
namespace App\Http\Middleware;

use Closure;
use Alertiqo\Laravel\Facades\Alertiqo;

class TrackApiCalls
{
    public function handle($request, Closure $next)
    {
        Alertiqo::addBreadcrumb([
            'message' => 'API call: ' . $request->path(),
            'category' => 'api',
            'level' => 'info',
            'data' => [
                'method' => $request->method(),
                'path' => $request->path()
            ]
        ]);

        return $next($request);
    }
}
```

Configuration Options
---------------------

[](#configuration-options)

### Environment Variables

[](#environment-variables)

```
# Enable/disable tracking
ALERTIQO_ENABLED=true

# API credentials
ALERTIQO_API_KEY=your-api-key

# Backend endpoint
ALERTIQO_ENDPOINT=http://localhost:3000

# Environment name
APP_ENV=production

# Release version
ALERTIQO_RELEASE=v1.0.0

# Debug mode
ALERTIQO_DEBUG=false

# Queue settings
ALERTIQO_USE_QUEUE=true
ALERTIQO_QUEUE=default

# SQL query logging
ALERTIQO_LOG_SQL=false
ALERTIQO_SQL_THRESHOLD=0

# Performance monitoring
ALERTIQO_PERFORMANCE_MONITORING=false
ALERTIQO_PERFORMANCE_THRESHOLD=1000

# Error sampling
ALERTIQO_SAMPLE_RATE=1.0
```

### Config File (`config/alertiqo.php`)

[](#config-file-configalertiqophp)

Customize behaviour in the config file:

- `enabled` - Enable/disable tracking
- `api_key` - Your API key
- `endpoint` - Backend URL
- `environment` - Environment name
- `release` - Release version
- `tags` - Default tags untuk semua errors
- `timeout` - HTTP timeout
- `use_queue` - Enable queue-based async reporting (default: true)
- `queue` - Queue name to use (default: 'default')
- `log_sql` - Capture SQL queries as breadcrumbs (default: false)
- `sql_threshold` - Only log queries above this time in ms (default: 0)
- `performance_monitoring` - Track slow requests (default: false)
- `performance_threshold` - Report requests slower than this in ms (default: 1000)
- `sample_rate` - Error sampling rate 0.0-1.0 (default: 1.0)
- `send_request_data` - Include request data in reports
- `sensitive_keys` - Keys to filter from request data
- `dont_report` - Exception classes to be excluded from reporting

Features
--------

[](#features)

✅ Automatic exception tracking
✅ Manual error capture
✅ Breadcrumbs tracking
✅ User context
✅ Custom tags
✅ Request data capture
✅ **SQL query logging** (with threshold filtering)
✅ **Performance monitoring** (track slow requests &amp; memory)
✅ **Error sampling** (for high-traffic apps)
✅ Sensitive data filtering
✅ Configurable exception filtering
✅ **Queue-based async reporting** (non-blocking, with auto-retry)
✅ Job/Queue support
✅ Event listener integration

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

[](#requirements)

- PHP 8.0 or higher
- Laravel 9.x, 10.x, or 11.x
- GuzzleHTTP 7.x

Testing
-------

[](#testing)

This package will be automatically disabled in testing environment. Set `ALERTIQO_ENABLED=false` in `.env.testing`.

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance66

Regular maintenance activity

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

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 ~1 days

Total

5

Last Release

200d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63188e5a567b1352306b9279475af9fa5d6730b0cbb9e24d6e12bfb3b75999e0?d=identicon)[hymns](/maintainers/hymns)

---

Top Contributors

[![hymns](https://avatars.githubusercontent.com/u/232046?v=4)](https://github.com/hymns "hymns (1 commits)")[![pisyek](https://avatars.githubusercontent.com/u/10695986?v=4)](https://github.com/pisyek "pisyek (1 commits)")

---

Tags

laravelmonitoringerror-trackingbug-detector

### Embed Badge

![Health badge](/badges/hymns-alertiqo-client-php/health.svg)

```
[![Health](https://phpackages.com/badges/hymns-alertiqo-client-php/health.svg)](https://phpackages.com/packages/hymns-alertiqo-client-php)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)

PHPackages © 2026

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