PHP code example of elysiumrealms / sql-interceptor
1. Go to this page and download the library: Download elysiumrealms/sql-interceptor library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
elysiumrealms / sql-interceptor example snippets
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));
}
}