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

Doctrine Doctor Laravel Package

ahmed-bhs/doctrine-doctor

Doctrine Doctor is a runtime analysis tool for Doctrine ORM integrated into the Symfony Web Profiler. It detects real-world issues like N+1 queries, slow queries, missing indexes, hydration overhead, and injection risks, with actionable backtraces and suggestions.

View on GitHub
Deep Wiki
Context7

layout: default title: Installation parent: Getting Started nav_order: 2

Installation

Detailed installation guide for Doctrine Doctor.


Requirements

  • PHP: 8.4 or higher
  • Symfony: 6.x, 7.x, or 8.x
  • Doctrine ORM: 3.x or 4.x

Install via Composer

composer require --dev ahmed-bhs/doctrine-doctor

{: .warning }

Development Only: Always install Doctrine Doctor as a development dependency (--dev). Never use it in production.


Symfony Flex Auto-Configuration

If you're using Symfony Flex, the bundle is automatically configured. The recipe creates:

config/
└── packages/
    └── dev/
        └── doctrine_doctor.yaml

with default configuration:

doctrine_doctor:
    enabled: true

Manual Configuration (Without Flex)

If you're not using Symfony Flex, register the bundle manually:

<?php
// config/bundles.php

return [
    // ...
    AhmedBhs\DoctrineDoctor\DoctrineDoctorBundle::class => ['dev' => true],
];

Then create the configuration file:

# config/packages/dev/doctrine_doctor.yaml
doctrine_doctor:
    enabled: true

Verify Installation

Check that the bundle is loaded:

php bin/console debug:container --parameter=kernel.bundles

You should see DoctrineDoctorBundle in the list.


Enable Backtraces (Optional but Recommended)

To see code location backtraces in issue reports:

# config/packages/dev/doctrine.yaml
doctrine:
    dbal:
        profiling_collect_backtrace: true

Troubleshooting

Bundle Not Showing in Profiler

  1. Check environment: Ensure you're in dev environment
  2. Clear cache: Run php bin/console cache:clear
  3. Check bundle registration: Verify bundle is in config/bundles.php with ['dev' => true]

No Issues Detected

  1. Execute queries: Make sure your page executes database queries
  2. Check configuration: Verify doctrine_doctor.enabled is true
  3. Review thresholds: Some analyzers might have high thresholds

Permission Issues

If using the Missing Index Analyzer, ensure your database user has SELECT permissions to execute EXPLAIN queries.


Next Steps

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.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui