onamfc/laravel-devlogger-dashboard
Install Dependencies
Run composer require onamfc/laravel-devlogger-dashboard and ensure onamfc/laravel-devlogger is installed.
Verify PHP ≥8.1 and Laravel ≥10.x.
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.
Run Migrations The package requires DevLogger’s tables. Run:
php artisan migrate
First Access
Visit /devlogger-dashboard (or your configured route). Authenticate via Laravel’s default guard.
DevLogger::error("Test error", ["trace" => true]) in your app.Error from the Level dropdown, and search for "Test error".Open, Resolved, or Ignored via the status column.ide_integration.scheme to vscode, phpstorm, or sublime.
Example:
'ide_integration' => [
'scheme' => 'vscode',
'port' => 3000, // VS Code server port
],
app/Http/Controllers/ExampleController.php:42).php artisan vendor:publish --tag=devlogger-dashboard-views to override:
resources/views/vendor/devlogger-dashboard/layouts/app.blade.phpresources/views/vendor/devlogger-dashboard/index.blade.phpresources/views/vendor/devlogger-dashboard/partials/styles.blade.php.Gate::define('view-devlogger', function ($user) {
return $user->isAdmin(); // Custom logic
});
routes/web.php:
Route::middleware(['auth', 'can:view-devlogger'])->get('/devlogger-dashboard', [\Onamfc\DevLoggerDashboard\Http\Controllers\DashboardController::class, 'index']);
LogServiceProvider is registered in config/app.php.php artisan devlogger:flush to clear old logs if needed.app/Http/Livewire.LogExporter component to handle bulk exports:
php artisan make:livewire LogExporter
use Onamfc\DevLoggerDashboard\Http\Controllers\DashboardController;
class ApiDashboardController extends DashboardController {
public function apiIndex() {
return response()->json($this->getLogs());
}
}
IDE Integration Failures
ide_integration.scheme and port match your IDE’s server settings.
Settings > Languages & Frameworks > PHP > Servers for the correct mapping.Performance with Large Logs
Schema::table('devlogger_logs', function (Blueprint $table) {
$table->index('level');
$table->index('status');
$table->index('created_at');
});
config/devlogger-dashboard.php:
'pagination' => [
'per_page' => 50,
],
Dark Mode Conflicts
dark:bg-gray-800, etc.) or override with:
@layer components {
.dark .custom-class {
@apply dark:bg-custom-dark;
}
}
Livewire Updates Not Reflecting
php artisan livewire:discover
php artisan view:clear
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.
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.
Authorization Errors Use Laravel’s debug toolbar to inspect gates/policies:
php artisan route:list | grep devlogger
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'];
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]);
}
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(),
];
}
Localization Publish language files and extend:
php artisan vendor:publish --tag=devlogger-dashboard-lang
Add translations to resources/lang/en/devlogger-dashboard.php.
How can I help you explore Laravel packages today?