定制 onamfc/laravel-devlogger-dashboard 二次开发

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

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

onamfc/laravel-devlogger-dashboard

Composer 安装命令:

composer require onamfc/laravel-devlogger-dashboard

包简介

A beautiful dashboard for managing Laravel DevLogger records with IDE integration

README 文档

README

Packagist License

A beautiful, feature-rich dashboard for managing Laravel DevLogger records with IDE integration and advanced filtering capabilities.

Features

  • Stunning UI - Modern, responsive design with dark mode support
  • Advanced Search & Filtering - Search by message, exception class, file path, level, status, and date range
  • IDE Integration - Click to open files directly in your IDE (VS Code, PhpStorm, Sublime, Atom)
  • Real-time Statistics - Dashboard overview with log counts and status summaries
  • Secure Access - Environment-based access control with authentication and authorization
  • Live Updates - Built with Laravel Livewire for reactive user experience
  • Mobile Responsive - Works perfectly on all device sizes
  • Dark Mode - Beautiful dark theme with automatic persistence

Requirements

  • PHP 8.1+
  • Laravel 10.0+, 11.0+ or 12.0+
  • Laravel Livewire 3.0+
  • onamfc/laravel-devlogger package

Installation

  1. Install the package via Composer:
  composer require onamfc/laravel-devlogger-dashboard
  1. Publish the configuration file:
  php artisan vendor:publish --tag=devlogger-dashboard-config
  1. (Optional) Publish the views for customization:
  php artisan vendor:publish --tag=devlogger-dashboard-views
  1. (Optional) Publish the assets:
  php artisan vendor:publish --tag=devlogger-dashboard-assets

Configuration

The package configuration is located at config/devlogger-dashboard.php. Key configuration options include:

Environment Access Control

'allowed_environments' => [
    'local',
    'staging',
    'development'
],

Authentication & Authorization

'require_auth' => env('DEVLOGGER_DASHBOARD_AUTH', true),
'authorization_gate' => env('DEVLOGGER_DASHBOARD_GATE', null),
'allowed_ips' => env('DEVLOGGER_DASHBOARD_IPS') ? explode(',', env('DEVLOGGER_DASHBOARD_IPS')) : [],

IDE Integration

'ide' => [
    'default' => env('DEVLOGGER_IDE', 'vscode'),
    'handlers' => [
        'vscode' => 'vscode://file/{file}:{line}',
        'phpstorm' => 'phpstorm://open?file={file}&line={line}',
        'sublime' => 'subl://open?url=file://{file}&line={line}',
        'atom' => 'atom://core/open/file?filename={file}&line={line}',
    ]
],

Environment Variables

Add these to your .env file:

# Dashboard Configuration
DEVLOGGER_DASHBOARD_PREFIX=devlogger
DEVLOGGER_DASHBOARD_AUTH=true
DEVLOGGER_DASHBOARD_GATE=null
DEVLOGGER_DASHBOARD_IPS=

# IDE Configuration
DEVLOGGER_IDE=vscode
DEVLOGGER_BASE_PATH=/path/to/your/project
DEVLOGGER_SHOW_FILE_PREVIEW=true

# UI Configuration
DEVLOGGER_THEME=dark
DEVLOGGER_BRAND_NAME="DevLogger Dashboard"
DEVLOGGER_AUTO_REFRESH=false

Usage

Accessing the Dashboard

Once installed, visit /devlogger in your browser (or your configured route prefix). The dashboard will only be accessible in allowed environments and to authenticated users.

IDE Integration Setup

VS Code

  1. Install the "Open in Application" extension or similar
  2. The dashboard will generate vscode://file/path/to/file:line URLs
  3. Click any file path in the dashboard to open it directly in VS Code

PhpStorm

  1. Enable "Remote call" in PhpStorm settings
  2. The dashboard will generate phpstorm://open?file=path&line=number URLs
  3. Click any file path to open it in PhpStorm

Other IDEs

Configure your IDE to handle custom URL schemes, or use the "Copy Path" button as a fallback.

Authorization Gates

You can create a custom authorization gate to control dashboard access:

// In your AuthServiceProvider
Gate::define('access-devlogger-dashboard', function ($user) {
    return $user->hasRole('developer') || $user->email === 'admin@example.com';
});

Then set in your .env:

DEVLOGGER_DASHBOARD_GATE=access-devlogger-dashboard

Custom Middleware

The package includes DevLoggerDashboardMiddleware which handles:

  • Environment checking
  • IP allowlisting
  • Authentication verification
  • Authorization gate checking

You can extend or replace this middleware by binding your own implementation.

Features Overview

Dashboard Statistics

  • Total log count
  • Today's logs
  • Error and warning counts
  • Open vs resolved status counts

Advanced Filtering

  • Search across message, exception class, file path, and request URL
  • Filter by log level (emergency, alert, critical, error, warning, notice, info, debug)
  • Filter by status (open, resolved)
  • Date range filtering
  • Sortable columns

Log Management

  • View detailed log information
  • Mark logs as resolved or reopen them
  • Delete individual logs or bulk delete
  • Copy file paths to clipboard
  • Open files directly in your IDE

File Preview

  • View code context around the error line
  • Syntax highlighting for better readability
  • Highlighted target line where the error occurred

Security Considerations

  • Environment Restriction: Only accessible in configured environments
  • Authentication Required: Users must be logged in (configurable)
  • Authorization Gates: Optional fine-grained access control
  • IP Allowlisting: Optional IP-based access restriction
  • No Public Access: Designed specifically for development environments

Customization

Views

Publish the views to customize the UI:

  php artisan vendor:publish --tag=devlogger-dashboard-views

Views will be published to resources/views/vendor/devlogger-dashboard/.

Styling

The dashboard uses Tailwind CSS with a custom configuration. You can override styles by publishing the views and modifying the templates.

Adding Custom Actions

You can extend the Livewire components to add custom functionality:

// Create your own component extending the base
class CustomLogDashboard extends \Onamfc\DevLoggerDashboard\Http\Livewire\LogDashboard
{
    public function customAction()
    {
        // Your custom logic here
    }
}

API Reference

Services

IdeService

Handles IDE URL generation:

$ideService = app(\Onamfc\DevLoggerDashboard\Services\IdeService::class);
$url = $ideService->generateIdeUrl('/path/to/file.php', 123);

FileService

Handles file preview generation:

$fileService = app(\Onamfc\DevLoggerDashboard\Services\FileService::class);
$preview = $fileService->getFilePreview('/path/to/file.php', 123, 10);

Troubleshooting

Dashboard Not Accessible

  1. Check that you're in an allowed environment
  2. Verify authentication is working
  3. Check IP allowlist configuration
  4. Ensure the route prefix is correct

IDE Links Not Working

  1. Verify your IDE supports custom URL schemes
  2. Check the IDE configuration in the config file
  3. Ensure file paths are absolute
  4. Try the "Copy Path" fallback option

File Previews Not Showing

  1. Check file permissions
  2. Verify the base path configuration
  3. Ensure files exist at the specified paths
  4. Check the show_preview configuration

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This package is open-sourced software licensed under the MIT license.

Support

If you encounter any issues or have questions, please open an issue on the GitHub repository.

onamfc/laravel-devlogger-dashboard 适用场景与选型建议

onamfc/laravel-devlogger-dashboard 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 07 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「logging」 「debugging」 「laravel」 「dashboard」 「livewire」 「devlogger」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 onamfc/laravel-devlogger-dashboard 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 onamfc/laravel-devlogger-dashboard 我们能提供哪些服务?
定制开发 / 二次开发

基于 onamfc/laravel-devlogger-dashboard 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-14