elysiumrealms / sql-interceptor
SQL Interceptor for Laravel
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/elysiumrealms/sql-interceptor
Requires
- php: ^7.3|^8.0
- laravel/framework: ^8.12
Requires (Dev)
- phpunit/phpunit: ^9.3.3
README
Description
SQLInterceptor is a tool for intercepting SQL queries. It can be used to perform a dry-run and capture SQL queries being executed within a closure.
Features
-
Intercept SQL queries
use Elysiumrealms\SQLInterceptor\SQLInterceptor; class TaskExcelExporter extends AbstractExporter { public function export() { $queries = SQLInterceptor::intercept(function () { // Complex logic which fetch from database connection // and cannot be pass into Laravel Job })->queries(); // Pass into Laravel Job execyte async dispatch(new AsyncQueryJob($queries)); } }