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 Slower

Laravel Slower Laravel Package

halilcosdu/laravel-slower

Detect and log slow Laravel database queries, then get AI-powered suggestions for indexes and query improvements. Configurable thresholds, can run with or without AI, and supports Laravel 10–13 on PHP 8.2+.

View on GitHub
Deep Wiki
Context7

★ Find slow database queries, get AI-powered optimization tips, and browse them in a built-in dashboard — for Laravel.

Frequently asked questions about Laravel Slower
How do I install Laravel Slower in a Laravel 12.x project?
Run `composer require halilcosdu/laravel-slower` in your project directory. The package supports Laravel 12.x natively with no additional steps. Ensure PHP 8.2+ is installed, as it’s a requirement for Laravel 12.x compatibility.
Does Laravel Slower work with Laravel 13.x, and are there any breaking changes?
Yes, Laravel Slower fully supports Laravel 13.x with no breaking changes in v2.1.0. The package leverages updated dependencies like Orchestra Testbench 11.x and PHPUnit 11+ to ensure seamless integration with Laravel 13’s new features, including improved model events.
Can I disable AI recommendations to avoid OpenAI API costs?
Yes, set `ai_recommendation` to `false` in the published config file. This disables AI-powered suggestions entirely, preventing API calls to OpenAI while retaining slow query logging functionality. Useful for production environments where cost control is critical.
What’s the minimum query execution time threshold for logging slow queries?
The default threshold is 10,000 milliseconds (10 seconds). Adjust it in the config file under the `threshold` key to match your application’s performance needs. Lower values capture slower queries but may increase log volume.
How does Laravel Slower handle database connections in multi-environment setups?
Laravel Slower uses Eloquent’s built-in connection handling, so it respects your `.env` configuration for different environments (e.g., `DB_CONNECTION=mysql`). Ensure your `SLOWER_ENABLED` env variable is set per environment to control logging behavior.
Are there alternatives to Laravel Slower for Laravel 9.x or older projects?
Laravel Slower no longer supports Laravel 9.x or older. For legacy projects, consider alternatives like `barryvdh/laravel-debugbar` (for query inspection) or `spatie/laravel-query-logger` (for manual logging). Upgrading to Laravel 10.x first is recommended for full compatibility.
How can I customize the AI prompt for query recommendations?
The package allows custom AI prompts via the config file. Modify the `ai_prompt` key to tailor recommendations to your database schema or specific optimization goals. Test changes in a staging environment to validate the output before production use.
Will Laravel Slower impact production performance during monitoring?
Minimal impact is expected, as the package only logs queries exceeding the threshold. However, enabling AI recommendations adds latency due to OpenAI API calls. Disable AI in production (`ai_recommendation=false`) or use a staging environment for testing.
How do I test Laravel Slower in a CI/CD pipeline?
Use Laravel’s Testbench to simulate slow queries in unit tests. The package includes GitHub Actions workflows for PHPUnit 11+ and Pest, ensuring compatibility. Mock AI responses in tests to avoid OpenAI API costs during CI runs.
What happens if OpenAI’s API is unavailable or rate-limited?
The package gracefully falls back to logging slow queries without AI recommendations. Configure a retry mechanism or fallback prompts in the config to handle intermittent API issues. Monitor OpenAI’s status page for outages.
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor