PHP code example of kombee-technologies / smart-index-advisor

1. Go to this page and download the library: Download kombee-technologies/smart-index-advisor 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/ */

    

kombee-technologies / smart-index-advisor example snippets


   App\Providers\IndexAdvisorServiceProvider::class,
   

   App\Providers\IndexAdvisorServiceProvider::class,
   

// Laravel 10 — app/Console/Kernel.php
protected function schedule(Schedule $schedule): void
{
    // Automatically purge old applied/dismissed recommendations
    $schedule->command('index-advisor:purge')->weekly()->sundays()->at('02:00');

    // Only if report_email is configured:
    $schedule->command('index-advisor:report')->weekly()->mondays()->at('08:00');
}

// Laravel 11+ — routes/console.php
use Illuminate\Support\Facades\Schedule;

// Automatically purge old applied/dismissed recommendations
Schedule::command('index-advisor:purge')->weekly()->sundays()->at('02:00');

// Only if report_email is configured:
Schedule::command('index-advisor:report')->weekly()->mondays()->at('08:00');

'table_map' => [
    'LymLeadMstr'   => 'lym_lead_mstrs',
    'LytLoginUsr'   => 'lytLoginUsr',     // mixed-case tables use exact name
    'CtmInfluncr'   => 'ctmInfluncr',
    'LymInfluncr'   => 'lymInfluncr',
    'LytCodeHsty'   => 'lytCodeHsty',
    // add more as needed ...
],

'table_map' => [
    'YourModelName' => 'your_actual_table',
],
bash
php artisan index-advisor:install
bash
php artisan migrate
bash
php artisan index-advisor:generate-migrations
bash
php artisan index-advisor:run \
  --skip-code-analysis \
  --skip-local-db \
  --skip-explain \
  --report-only
bash
php artisan index-advisor:run [options]
bash
php artisan index-advisor:analyze-code
bash
php artisan index-advisor:run-explain [--limit=50]
bash
php artisan index-advisor:report [--email=address]
bash
php artisan index-advisor:generate-migrations [options]
bash
php artisan index-advisor:mark-applied [id] [options]
bash
php artisan index-advisor:reconcile [options]
bash
php artisan index-advisor:purge [options]
bash
php artisan index-advisor:diagnose [--table=name]
bash
php artisan index-advisor:status
bash
php artisan index-advisor:analyze-code
bash
php artisan config:clear
bash
php artisan index-advisor:reconcile --table=yourTableName
bash
php artisan index-advisor:reconcile --table=lytLoginUsr --column=userLyId
bash
php artisan index-advisor:diagnose
php artisan index-advisor:diagnose --table=lym_lead_mstrs