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

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

ranetrace/ranetrace-laravel
===========================

This package provides the integration for Ranetrace, a tool for monitoring your Laravel applications.

v1.0.25(3mo ago)2621MITPHPPHP ^8.4CI failing

Since Sep 13Pushed 3w ago1 watchersCompare

[ Source](https://github.com/ranetrace/ranetrace-laravel)[ Packagist](https://packagist.org/packages/ranetrace/ranetrace-laravel)[ Docs](https://github.com/ranetrace/ranetrace-laravel)[ RSS](/packages/ranetrace-ranetrace-laravel/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (13)Versions (36)Used By (0)

Ranetrace: Web Application Monitoring for Laravel
=================================================

[](#ranetrace-web-application-monitoring-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/434302979fa2356c8b9bb45e3aa00433267dbd47414e5621508b6e3946dcb85f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616e6574726163652f72616e6574726163652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ranetrace/ranetrace-laravel)[![Total Downloads](https://camo.githubusercontent.com/8392bf6a9e269e89b1e3796c37d504dd88d6988aa16b29ebe8dafc4e8fbcdd08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72616e6574726163652f72616e6574726163652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ranetrace/ranetrace-laravel)

Ranetrace is an all-in-one tool for **Error Tracking**, **Website Analytics**, and **Website Monitoring** for Laravel applications.

- Alerts you about errors and provides the context you need to fix them
- Privacy-first, fully server-side website analytics — no cookies, no fingerprinting, no intrusive scripts
- Monitors uptime, performance, SSL certificates, domain and DNS status, Lighthouse scores, and broken links

Check out the [Ranetrace website](https://ranetrace.com) for more information.

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

[](#installation)

Install the package via Composer:

```
composer require ranetrace/ranetrace-laravel
```

Add your Ranetrace key to `.env`:

```
RANETRACE_KEY=your-key-here
```

Optionally publish the config file:

```
php artisan vendor:publish --tag="ranetrace-laravel-config"
```

### Schedule the work command

[](#schedule-the-work-command)

Captured items (errors, events, logs, page visits, JS errors) are buffered locally and sent to Ranetrace in batches by the `ranetrace:work` artisan command. Add it to your scheduler:

```
// In your scheduler (routes/console.php on Laravel 11+, or app/Console/Kernel.php on Laravel 10)
Schedule::command('ranetrace:work')
    ->everyMinute()
    ->withoutOverlapping()
    ->runInBackground();
```

> **Don't skip this step.** Without it, buffered telemetry never reaches Ranetrace. Run `php artisan ranetrace:status` at any time to verify health and see whether buffers are draining.

Usage
-----

[](#usage)

### Error Tracking

[](#error-tracking)

Wire Ranetrace into Laravel's exception handling in `bootstrap/app.php`:

```
use Illuminate\Foundation\Configuration\Exceptions;
use Ranetrace\Laravel\Facades\Ranetrace;

return Application::configure(basePath: dirname(__DIR__))
    // ...
    ->withExceptions(function (Exceptions $exceptions) {
        Ranetrace::handles($exceptions);
    })
    ->create();
```

That's it — every unhandled exception is now reported to your Ranetrace dashboard (alongside Laravel's normal logging). You can also capture exceptions in-flow:

```
use Ranetrace\Laravel\Facades\Ranetrace;

try {
    // ...
} catch (Throwable $e) {
    Ranetrace::report($e);
    throw $e;
}
```

Test your setup with:

```
php artisan ranetrace:test-errors
```

### JavaScript Error Tracking

[](#javascript-error-tracking)

1. Enable it in your `.env`:

```
RANETRACE_JAVASCRIPT_ERRORS_ENABLED=true
```

2. Add the Blade directive to your layout:

```

    @yield('content')

    @ranetraceErrorTracking

```

The directive injects a small script that captures `window.onerror`, unhandled promise rejections, and (optionally) `console.error` calls. It also collects breadcrumbs for clicks, form submissions, and XHR/fetch activity to give you context around each error.

You can also capture errors manually:

```
window.Ranetrace.captureError(error, { payment_amount: amount });
```

### Event Tracking

[](#event-tracking)

Track custom events with a privacy-first approach — no IP addresses are stored, user agents are hashed, and session IDs rotate daily.

```
use Ranetrace\Laravel\Facades\Ranetrace;

Ranetrace::trackEvent('button_clicked', [
    'button_id' => 'header-cta',
    'page' => 'homepage'
]);
```

E-commerce helpers are available via the `RanetraceEvents` facade:

```
use Ranetrace\Laravel\Facades\RanetraceEvents;

RanetraceEvents::sale(
    orderId: 'ORDER-456',
    totalAmount: 89.97,
    products: [['id' => 'PROD-123', 'name' => 'Widget', 'price' => 29.99, 'quantity' => 3]],
    currency: 'USD'
);
```

Test your setup with:

```
php artisan ranetrace:test-events
```

### Centralized Logging

[](#centralized-logging)

Enable it in your `.env`:

```
RANETRACE_LOGGING_ENABLED=true
```

The package auto-registers a `ranetrace` log channel — no `config/logging.php` edit is required. Add it to your existing log stack so application logs are routed to both your normal destination AND Ranetrace:

```
// config/logging.php — example stacked channel
'channels' => [
    'production' => [
        'driver' => 'stack',
        'channels' => array_merge(explode(',', env('LOG_STACK', 'single')), ['ranetrace']),
        'ignore_exceptions' => false,
    ],
],
```

Then point Laravel at it:

```
LOG_CHANNEL=production
```

By default the package captures `notice` and above. Tune via `RANETRACE_LOGGING_LEVEL`.

Test your setup with:

```
php artisan ranetrace:test-logging
```

### Website Analytics

[](#website-analytics)

Enable it in your `.env`:

```
RANETRACE_WEBSITE_ANALYTICS_ENABLED=true
```

The `TrackPageVisit` middleware is automatically added to the `web` middleware group. It applies extensive bot and crawler filtering before sending visits to your Ranetrace dashboard. No code changes needed.

See the [Ranetrace website](https://ranetrace.com) for dashboard setup and configuration details.

Health Check
------------

[](#health-check)

At any time, see what the package is doing:

```
php artisan ranetrace:status
```

Reports overall health, configured features, buffer sizes, pause states (if the API has rate-limited you), and recent failed jobs — both as formatted output and via `--json` for monitoring integrations.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ranetrace](https://github.com/ranetrace)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance89

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity69

Established project with proven stability

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

Recently: every ~68 days

Total

31

Last Release

100d ago

Major Versions

v0.1.5 → v1.02024-09-16

PHP version history (3 changes)v0.1PHP ^8.2

v1.0.7PHP ^8.3

v1.0.23PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a5439b12a6fcb6dc7a8feb08189c5dbba880552ede929a003e101e8123f5d33?d=identicon)[ranetrace](/maintainers/ranetrace)

---

Top Contributors

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

---

Tags

error-monitoringerror-reportinglaravelperformance-monitoringstatus-pageuptime-monitorwebsite-analyticslaravelranetraceranetrace-laravel

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[spatie/laravel-flare

Send Laravel errors to Flare

111.2M6](/packages/spatie-laravel-flare)

PHPackages © 2026

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