PHP code example of stratos / laravel-toolbox

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

    

stratos / laravel-toolbox example snippets


return [
    // Global settings
    'table_prefix' => 'toolbox_',
    'cache' => [
        'enabled' => true,
        'ttl' => 3600,
    ],

    // N+1 Scanner
    'n1-scanner' => [
        'paths' => ['app'],
        'models_path' => 'app/Models',
        'views_path' => 'resources/views',
    ],

    // Route Scanner
    'route-scanner' => [
        'ignore_routes' => ['debugbar.*', 'sanctum.*'],
    ],

    // Query Scanner
    'query-scanner' => [
        'paths' => ['app'],
        'ignore_patterns' => ['*Test.php', '*/migrations/*'],
    ],

    // Environment Scanner
    'env-scanner' => [
        'paths' => ['app', 'config', 'routes', 'database'],
        'system_keys' => ['APP_*', 'DB_*', 'LOG_*'],
    ],

    // Translation Scanner
    'translation-scanner' => [
        'paths' => ['app', 'resources/views'],
        'lang_path' => 'lang',
    ],

    // Dead Code Scanner
    'dead-code-scanner' => [
        'paths' => ['app'],
        'exclude_classes' => ['*Controller', '*Command', '*ServiceProvider'],
        'exclude_methods' => ['__*', 'boot', 'register', 'handle'],
    ],
];
bash
php artisan vendor:publish --tag=laravel-toolbox-config
bash
php artisan toolbox:scan-n1
php artisan toolbox:scan-n1 --severity=high
php artisan toolbox:scan-n1 --json --fail-on-issues
bash
php artisan toolbox:scan-queries
php artisan toolbox:scan-queries --type=raw-query --severity=critical
php artisan toolbox:scan-queries --json --fail-on-issues
bash
php artisan toolbox:scan-routes
php artisan toolbox:scan-routes --missing-only
php artisan toolbox:scan-routes --orphans-only
bash
php artisan toolbox:scan-security
php artisan toolbox:scan-security --severity=critical
php artisan toolbox:scan-security --type=sql-injection
bash
php artisan toolbox:scan-dead-code
php artisan toolbox:scan-dead-code --type=method --severity=high
php artisan toolbox:scan-dead-code --json --fail-on-issues
bash
php artisan toolbox:scan-dependencies
php artisan toolbox:scan-dependencies --type=circular --severity=critical
php artisan toolbox:scan-dependencies --max-dependencies=5 --json
bash
php artisan toolbox:scan-translations
php artisan toolbox:scan-translations --locale=es
php artisan toolbox:scan-translations --type=inconsistent