定制 ranetrace/ranetrace-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ranetrace/ranetrace-laravel

最新稳定版本:v1.0.25

Composer 安装命令:

composer require ranetrace/ranetrace-laravel

包简介

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

README 文档

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.

统计信息

  • 总下载量: 62
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固