PHP code example of jeytekdev / explain-lint-laravel

1. Go to this page and download the library: Download jeytekdev/explain-lint-laravel 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/ */

    

jeytekdev / explain-lint-laravel example snippets


'connections' => [
    'default' => [
        'driver' => 'mysql', // or 'pgsql'
    ],
],

// Every violation on this table, regardless of query:
'allowlist' => [
    'audit_log' => 'Intentional full scan for the nightly export — JIRA-123',
],

// One specific query, by the fingerprint shown in the report above:
'allowlist_fingerprints' => [
    '4f6a1c3e9d2b7a805e4f1c9b6d3a2e7f8c0b1a5d' => 'Known slow report query — JIRA-456',
],

use ExplainLint\Laravel\Testing\ExplainLintTesting;

final class CheckoutTest extends TestCase
{
    use ExplainLintTesting;

    public function test_checkout_query_has_no_regressions(): void
    {
        $this->get('/checkout');

        $this->assertNoQueryRegressions();
    }
}

'report' => [
    'junit' => 'build/explain-lint.xml',
],
xml
<extensions>
    <bootstrap class="ExplainLint\PHPUnit\ExplainLintExtension">
        <parameter name="config" value="explain-lint.php"/>
    </bootstrap>
</extensions>