ranetrace/ranetrace-laravel

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

Maintainers

Package info

github.com/ranetrace/ranetrace-laravel

pkg:composer/ranetrace/ranetrace-laravel

Statistics

Installs: 44

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v1.0.25 2026-03-18 15:56 UTC

README

Latest Version on Packagist Total Downloads

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 for more information.

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"

Usage

Error Tracking

Error tracking is enabled by default. Once installed, unhandled exceptions are automatically reported to your Ranetrace dashboard.

JavaScript Error Tracking

  1. Enable it in your .env:
RANETRACE_JAVASCRIPT_ERRORS_ENABLED=true
  1. Add the Blade directive to your layout:
<body>
    @yield('content')

    @ranetraceErrorTracking
</body>

You can also capture errors manually:

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

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

Send your application logs to Ranetrace by adding the driver to config/logging.php:

'channels' => [
    'ranetrace' => [
        'driver' => 'ranetrace',
        'level' => 'error',
    ],

    'production' => [
        'driver' => 'stack',
        'channels' => array_merge(explode(',', env('LOG_STACK', 'single')), ['ranetrace']),
        'ignore_exceptions' => false,
    ],
],

Then enable it in your .env:

LOG_CHANNEL=production
RANETRACE_LOGGING_ENABLED=true

Test your setup with:

php artisan ranetrace:test-logging

Website Analytics

Refer to the Ranetrace website for setup instructions.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.