dazza-dev/pulse-duplicate-queries

Laravel Pulse Duplicate Queries provides a ready-to-use list of duplicate queries for your Laravel application.

v1.0.0 2025-05-22 16:23 UTC

This package is auto-updated.

Last update: 2025-05-22 16:26:26 UTC


README

PulseDuplicateQueriesPreview

A Laravel Pulse recorder and card package designed to monitor and visualize database query duplication per HTTP request.

Installation

Require the package with Composer:

composer require dazza-dev/pulse-duplicate-queries

Register the recorder

Right now, in each request, the system will check how many queries are being executed and how many of them are duplicated. To run the checks you must add the DuplicatedQueriesRecorder to the config/pulse.php file.

    'recorders' => [
        \DazzaDev\PulseDuplicateQueries\Recorders\DuplicateQueriesRecorder::class => [
            'enabled' => env('PULSE_DUPLICATED_QUERIES_BY_REQUEST_ENABLED', true),
            'sample_rate' => env('PULSE_DUPLICATED_QUERIES_BY_REQUEST_SAMPLE_RATE', 1)
        ],
    ]

You also need to be running the pulse:check command.

Add to your dashboard

To add the card to the Pulse dashboard, you must first publish the vendor view.

Then, you can modify the resources/views/vendor/pulse/dashboard.blade.php file:

<livewire:duplicate-queries cols='4' rows='2' />

Contributions

Contributions are welcome. If you find any bugs or have ideas for improvements, please open an issue or send a pull request. Make sure to follow the contribution guidelines.

Author

Laravel Batch Validation was created by DAZZA.

License

This project is licensed under the MIT License.