PHP code example of stellarsecurity / application-insights-laravel

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

    

stellarsecurity / application-insights-laravel example snippets




$queryParamRulesJson = trim((string) env('STELLAR_AI_QUERY_PARAM_RULES', '{}'));
$queryParamRules = json_decode($queryParamRulesJson === '' ? '{}' : $queryParamRulesJson, true);

if (! is_array($queryParamRules)) {
    $queryParamRules = null;
}

return [

    'connection_string' => env(
        'STELLAR_AI_CONNECTION_STRING',
        env(
            'APPLICATIONINSIGHTS_CONNECTION_STRING',
            env('APPINSIGHTS_CONNECTION_STRING', '')
        )
    ),

    'instrumentation_key' => env(
        'STELLAR_AI_INSTRUMENTATION_KEY',
        env(
            'APPINSIGHTS_INSTRUMENTATIONKEY',
            env('APPINSIGHTS_INSTRUMENTATION_KEY', '')
        )
    ),

    'use_queue' => env('STELLAR_AI_USE_QUEUE', false),
    'buffer_limit' => (int) env('STELLAR_AI_BUFFER_LIMIT', 10),
    'auto_flush' => env('STELLAR_AI_AUTO_FLUSH', true),
    'trace_per_request' => env('STELLAR_AI_TRACE_PER_REQUEST', true),

    '
bash
php artisan vendor:publish --tag=stellar-ai-config
bash
php artisan config:clear
php artisan config:cache
text
https://example.com/api/orders?token=super-secret&customer_id=12345678&reference=ABCDEFGH&utm_source=google&debug=1
text
https://example.com/api/orders?token=<removed>&customer_id=<removed>5678&reference=ABCDEF<removed>&utm_source=google
bash
php artisan queue:work
bash
php artisan config:clear
php artisan config:cache
bash
php artisan config:clear
php artisan config:cache
bash
composer install
php tests/query_param_rules_smoke.php
bash
php artisan vendor:publish --tag=stellar-ai-config
php artisan config:clear
php artisan config:cache