PHP code example of sagrmore / indexpilot

1. Go to this page and download the library: Download sagrmore/indexpilot 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/ */

    

sagrmore / indexpilot example snippets


use IndexPilot\Laravel\Facades\IndexPilot;

$result = IndexPilot::analyze('SELECT id FROM users WHERE email = ?', ['[email protected]']);
echo $result->getScore();

$report = IndexPilot::builder()
    ->queries(['SELECT * FROM orders WHERE status = ?'])
    ->toReport('markdown');
bash
php artisan vendor:publish --tag=indexpilot-config
bash
php artisan indexpilot:analyze "SELECT * FROM users WHERE email = ?" --format=json
php artisan indexpilot:report --file=workload.sql --format=sarif --output=storage/app/indexpilot.sarif
php artisan indexpilot:doctor
php artisan indexpilot:rules