PHP code example of promptphp / intercept-support

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

    

promptphp / intercept-support example snippets




declare(strict_types=1);

return [
    'middleware' => [
        'injection_guard' => [
            'action'             => 'block',
            'patterns'           => [],
            'merge_patterns'     => true,
            'normalise_prompt'   => true,
            'log_prompt_preview' => false,
        ],
    ],
];

use PromptPHP\Intercept\Support\InterceptConfig;

$config = InterceptConfig::middleware('injection_guard', [
    'action'             => 'block',
    'patterns'           => [],
    'merge_patterns'     => true,
    'normalise_prompt'   => true,
    'log_prompt_preview' => false,
]);

PromptPHP\Intercept\Support\InterceptServiceProvider::class

$config = InterceptConfig::middleware(
    'pii_redactor',
    PIIRedactorDefaults::values(),
);
text
config/intercept.php
bash
php artisan vendor:publish --tag=intercept-config