datlechin/flarum-debugbar

Integrate Debugbar into Flarum for development debugging

Maintainers

Package info

github.com/datlechin/flarum-debugbar

Type:flarum-extension

pkg:composer/datlechin/flarum-debugbar

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.2 2026-03-17 01:17 UTC

This package is auto-updated.

Last update: 2026-03-17 01:20:08 UTC


README

License Latest Stable Version Total Downloads

Integrates PHP Debugbar into Flarum 2.x, providing a powerful in-browser debug toolbar for development. Inspect SQL queries, events, routes, authentication, cache operations, mail, and more.

Warning: This is a development tool. Never enable debug mode on production sites.

Overview

Queries

Installation

composer require datlechin/flarum-debugbar:"*"

Enable the extension in the admin panel, then ensure debug is set to true in your config.php:

'debug' => true,

Publish debugbar assets (usually automatic, but can be done manually):

php flarum debugbar:publish

Features

Debugbar Tabs

Tab Description
Messages Log messages from the request lifecycle
Timeline Visual breakdown of request timing (forum, handler, API calls)
Exceptions PHP exceptions and errors
Flarum Framework version, PHP version, database/queue/cache/mail/session drivers
Queries All SQL queries with bindings and execution time
Route Matched route name, handler, HTTP method, parameters
Auth Current user, groups, authentication method, session info
API JSON:API resource, endpoint, includes, filters, pagination
Settings All Flarum settings grouped by extension (sensitive values masked)
Events All events fired during the request
Cache Cache hits, misses, writes, and deletes
Mail Emails sent/queued during the request
Extensions All enabled extensions with versions

Console Commands

php flarum debugbar:publish   # Publish/repair debugbar assets symlink
php flarum debugbar:clear     # Clear stored request history

For Extension Developers

Use DebugbarHelper to log messages and measure performance from your extension code:

use Datlechin\FlarumDebugbar\DebugbarHelper;

// Log messages
DebugbarHelper::info('Loading custom data');
DebugbarHelper::warning('Deprecated method called');
DebugbarHelper::error('Something went wrong');
DebugbarHelper::debug('Variable value: ' . $value);

// Measure execution time
DebugbarHelper::startMeasure('my-operation', 'My Heavy Operation');
// ... do work ...
DebugbarHelper::stopMeasure('my-operation');

// Add exceptions
DebugbarHelper::addException($e);

All methods are safe to call even when the debugbar is disabled, they silently no-op.

Links