定制 officineweb/laracheck-client 二次开发

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

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

officineweb/laracheck-client

最新稳定版本:1.0.0

Composer 安装命令:

composer require officineweb/laracheck-client

包简介

Laracheck Client - Track exceptions and errors in your Laravel applications

README 文档

README

Laracheck Client

Automatic Exception Tracking for Laravel Applications

Send exceptions from your Laravel app to your Laracheck monitoring server with zero configuration.

Packagist License Laravel PHP

🚀 Installation

Install the package via Composer:

composer require officineweb/laracheck-client

⚡ Quick Setup (3 Steps)

1. Publish Configuration

php artisan vendor:publish --tag=laracheck-config

2. Add Credentials to .env

Get your API key from your Laracheck dashboard and add to .env:

LARACHECK_KEY=your-api-key-from-laracheck-dashboard
LARACHECK_URL=https://your-laracheck-server.com

3. Register Exception Tracking

In your bootstrap/app.php, add exception tracking:

use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware): void {
        //
    })
    ->withExceptions(function (Exceptions $exceptions): void {
        // 👇 Add this line
        app('laracheck')->track($exceptions);
    })
    ->create();

That's it! 🎉 Your application will now automatically send exceptions to Laracheck.

📊 What Gets Tracked

The client automatically captures:

  • ✅ Exception message and stack trace
  • ✅ File path and line number
  • ✅ HTTP method and full URL
  • ✅ Environment (local, staging, production)
  • ✅ HTTP status code
  • ✅ Authenticated user information
  • ✅ Request metadata (IP, user agent)
  • ✅ Server information

Smart Tracking

  • 4xx errors (404, 403, etc.) are auto-marked as fixed with no alerts
  • 5xx errors (500, 503, etc.) trigger immediate notifications
  • Environment-aware - separates local, staging, and production exceptions

🔒 Security

  • API key authentication for all requests
  • Secure HTTPS communication
  • No sensitive data is sent (passwords, tokens, etc.)
  • Failed requests fail silently to avoid infinite loops

📝 Example Data Structure

{
  "exception": "ErrorException: Undefined variable",
  "file": "app/Http/Controllers/UserController.php",
  "line": "42",
  "class": "ErrorException",
  "code": 500,
  "method": "GET",
  "fullUrl": "https://myapp.com/users/123",
  "host": "myapp.com",
  "env": "production",
  "user": {
    "id": 1,
    "email": "user@example.com",
    "name": "John Doe"
  }
}

🌐 Laracheck Server

This client requires a Laracheck server instance. Get started:

git clone https://github.com/officineweb/laracheck.git
cd laracheck
composer install
php artisan migrate
php artisan serve

Visit the Laracheck Server Repository for complete installation instructions.

🛠️ Requirements

  • PHP 8.1 or higher
  • Laravel 9.x, 10.x, 11.x, or 12.x
  • Guzzle HTTP client (auto-installed)

🤝 Contributing

Contributions are welcome! Please submit issues and pull requests to the GitHub repository.

📄 License

The MIT License (MIT). See LICENSE for more information.

💙 Credits

Built with ❤️ by Officine Web

Keep your Laravel apps bug-free!
View Laracheck Server⭐ Star on GitHub

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-26