Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Devlogger Dashboard Laravel Package

onamfc/laravel-devlogger-dashboard

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Install Dependencies Run composer require onamfc/laravel-devlogger-dashboard and ensure onamfc/laravel-devlogger is installed. Verify PHP ≥8.1 and Laravel ≥10.x.

  2. Publish Config Execute php artisan vendor:publish --tag=devlogger-dashboard-config to generate config/devlogger-dashboard.php. Update auth (e.g., ['guard' => 'web']) and ide_integration (e.g., ['scheme' => 'vscode']) as needed.

  3. Run Migrations The package requires DevLogger’s tables. Run:

    php artisan migrate
    
  4. First Access Visit /devlogger-dashboard (or your configured route). Authenticate via Laravel’s default guard.


First Use Case: Debugging a Critical Error

  1. Trigger a Log Use DevLogger::error("Test error", ["trace" => true]) in your app.
  2. Filter in Dashboard Navigate to the dashboard, select Error from the Level dropdown, and search for "Test error".
  3. Open in IDE Click the file path link to open the relevant file in VS Code/PhpStorm (requires IDE integration setup).

Implementation Patterns

Core Workflows

1. Log Management

  • Bulk Actions: Select logs → use dropdown to Delete, Mark as Resolved, or Export (CSV/JSON).
  • Status Tracking: Toggle logs between Open, Resolved, or Ignored via the status column.
  • Date Ranges: Use the calendar picker or preset ranges (e.g., "Last 7 Days") for temporal filtering.

2. IDE Integration

  • Configuration: Set ide_integration.scheme to vscode, phpstorm, or sublime. Example:
    'ide_integration' => [
        'scheme' => 'vscode',
        'port' => 3000, // VS Code server port
    ],
    
  • Click-to-Open: Log entries with file paths render as clickable links (e.g., app/Http/Controllers/ExampleController.php:42).

3. Customization

  • Views: Publish views with php artisan vendor:publish --tag=devlogger-dashboard-views to override:
    • resources/views/vendor/devlogger-dashboard/layouts/app.blade.php
    • resources/views/vendor/devlogger-dashboard/index.blade.php
  • Assets: Extend or replace CSS/JS by publishing assets and modifying resources/views/vendor/devlogger-dashboard/partials/styles.blade.php.

4. Authentication

  • Gate Integration: Restrict access via Laravel gates/policies. Example:
    Gate::define('view-devlogger', function ($user) {
        return $user->isAdmin(); // Custom logic
    });
    
  • Middleware: Add to routes/web.php:
    Route::middleware(['auth', 'can:view-devlogger'])->get('/devlogger-dashboard', [\Onamfc\DevLoggerDashboard\Http\Controllers\DashboardController::class, 'index']);
    

Integration Tips

Laravel DevLogger Sync

  • Ensure DevLogger’s LogServiceProvider is registered in config/app.php.
  • Use php artisan devlogger:flush to clear old logs if needed.

Livewire Components

  • Extend functionality by creating custom Livewire components in app/Http/Livewire.
  • Example: Add a LogExporter component to handle bulk exports:
    php artisan make:livewire LogExporter
    

API Access

  • Expose filtered logs via API by extending the controller:
    use Onamfc\DevLoggerDashboard\Http\Controllers\DashboardController;
    
    class ApiDashboardController extends DashboardController {
        public function apiIndex() {
            return response()->json($this->getLogs());
        }
    }
    

Gotchas and Tips

Pitfalls

  1. IDE Integration Failures

    • Issue: Clicking file links opens the wrong file/port.
    • Fix: Verify ide_integration.scheme and port match your IDE’s server settings.
      • VS Code: Ensure the Remote - Containers extension is running with the correct port.
      • PhpStorm: Check Settings > Languages & Frameworks > PHP > Servers for the correct mapping.
  2. Performance with Large Logs

    • Issue: Dashboard lags when querying >10K logs.
    • Fix:
      • Add indexes to DevLogger tables:
        Schema::table('devlogger_logs', function (Blueprint $table) {
            $table->index('level');
            $table->index('status');
            $table->index('created_at');
        });
        
      • Use pagination in config/devlogger-dashboard.php:
        'pagination' => [
            'per_page' => 50,
        ],
        
  3. Dark Mode Conflicts

    • Issue: Custom CSS breaks dark mode.
    • Fix: Use the package’s dark mode classes (dark:bg-gray-800, etc.) or override with:
      @layer components {
          .dark .custom-class {
              @apply dark:bg-custom-dark;
          }
      }
      
  4. Livewire Updates Not Reflecting

    • Issue: Changes to Livewire components aren’t visible.
    • Fix: Clear Livewire cache:
      php artisan livewire:discover
      php artisan view:clear
      

Debugging Tips

  1. Log Query Issues Enable DevLogger’s debug mode in config/devlogger.php:

    'debug' => env('DEVLOGGER_DEBUG', false),
    

    Check logs at storage/logs/laravel.log for SQL queries.

  2. IDE Link Debugging Test the IDE URL manually:

    curl "vscode://vscode-remote/extension/ms-vscode-remote.remote-containers/open?path=/path/to/file"
    

    Adjust the ide_integration.url config if needed.

  3. Authorization Errors Use Laravel’s debug toolbar to inspect gates/policies:

    php artisan route:list | grep devlogger
    

Extension Points

  1. Custom Log Levels Extend the level filter by modifying the Livewire component:

    // app/Http/Livewire/Dashboard/LogFilter.php
    protected $levels = ['Debug', 'Info', 'Warning', 'Error', 'Critical', 'CustomLevel'];
    
  2. Webhook Notifications Add a LogWebhook Livewire component to send Slack/email alerts:

    use Illuminate\Support\Facades\Http;
    
    public function sendAlert($logId) {
        $log = DevLogger::find($logId);
        Http::post('https://hooks.slack.com/...', ['text' => $log->message]);
    }
    
  3. Custom Metrics Override the dashboard stats by extending the controller:

    public function getStats() {
        return [
            'total_logs' => DevLogger::count(),
            'critical_logs' => DevLogger::where('level', 'Critical')->count(),
            'custom_metric' => DevLogger::where('message', 'like', '%custom%')->count(),
        ];
    }
    
  4. Localization Publish language files and extend:

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

    Add translations to resources/lang/en/devlogger-dashboard.php.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope