- How do I install ilzrv/laravel-slow-query-detector in a Laravel app?
- Install it with Composer: composer require ilzrv/laravel-slow-query-detector. The package follows standard Laravel package conventions, so the service provider is expected to be auto-discovered and any config file publishable via php artisan vendor:publish. Pin the version in composer.json for reproducible installs, then run your application's test suite. Verify the resolved dependency constraints before rolling out to shared environments.
- Which Laravel and PHP versions does laravel-slow-query-detector support?
- The v2.1.0 release notes explicitly call out Laravel 10 support, and the package's test matrix covers PHP 8.2. Because Laravel 10 requires PHP 8.1 or newer, PHP 8.1 is implied but not confirmed as tested. Laravel 11, Laravel 12, and PHP 8.3/8.4 support are not evidenced anywhere in the release notes, so treat those stacks as unverified. Confirm the composer.json platform constraints before adopting.
- How do I configure the slow query threshold?
- The threshold is configurable through the package configuration file, and queries exceeding the value you set trigger a warning. Choose a starting point based on your application's normal query profile rather than a guessed default. Tune the value per environment so local development noise does not flood your logs while genuine slow queries still surface.
- Where does the slow query detector log slow queries?
- Slow queries are surfaced as log warnings through Laravel's logging system, so they land in whichever channel your app is configured to use. Check config/logging.php and your log level to make sure the warnings are not filtered out. Many teams route these to a dedicated channel so slow query noise stays separate from application logs.
- Does laravel-slow-query-detector work with Laravel 11 and Laravel 12?
- That is not confirmed. The v2.1.0 release notes only mention Laravel 10, with no stated support for Laravel 11 or 12. Until the maintainer publishes an update or the version constraints visibly allow it, treat newer major versions as unverified. Test in a branch before letting it into a Laravel 11 or 12 upgrade path.
- Is it safe to run laravel-slow-query-detector in production?
- It is reasonable on a Laravel 10 / PHP 8.2 stack that has been smoke-tested in staging, which is the combination the release explicitly validates. The real production concerns are log volume and forward compatibility with future Laravel major upgrades, not runtime overhead. Pin the version, set a sensible threshold, and keep a fallback plan in case upstream maintenance stalls.
- How do I test that slow query detection is actually working?
- Trigger a deliberately slow query in a local or staging environment, for example a large table scan or an artificial delay, and confirm a warning appears in your configured log channel. If nothing appears, check the log level, the channel configuration, and the threshold value. Run this check in a branch or staging rather than production.
- How do I upgrade from v2.0.x to v2.1.0?
- It is a minor version bump, so under semantic versioning it should be additive and non-breaking: a composer update with no code changes expected. Before merging, confirm the resolved dependency constraints and run your application's test suite. If the Laravel 10 support change altered constraints in a way that affects your install, inspect composer why output for conflicts.
- What are alternatives to this package for finding slow queries in Laravel?
- Laravel Telescope records query timings and is often already installed in development stacks, while Laravel Debugbar gives quick request-level profiling. A custom DB::listen listener is a few lines of code and gives full control over thresholds and reporting. This package's value is a focused, low-configuration slow query warning rather than a full debugging suite.
- Is ilzrv/laravel-slow-query-detector actively maintained?
- The v2.1.0 release with an expanded test matrix is a positive maintenance signal, but release cadence, issue responsiveness, and long-term support commitments are not stated. Track release frequency and open issues on the GitHub repository before treating it as a long-term dependency. Keep a lightweight internal fallback, such as a DB::listen listener, in case upstream activity drops off.