PHP code example of qvbilam / audit

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

    

qvbilam / audit example snippets


use Qvbilam\Audit\Audit;
$audit = new Audit("key", "appId");
$response = $audit->text("文本内容");

return $response->toJson(); 

use Qvbilam\Audit\Audit;
$audit = new Audit("key", "appId");
$response = $audit->image("图片地址");

return $response->toJson(); 

'audit' => [
    "key" => env("AUDIT_KEY"),
    "app_id" => env("AUDIT_APP_ID"),
],

use Qvbilam\Audit\Audit;

public function auditText(Request $request, Audit $audit)
{
    $text = $request->query("txt");
    $audit = $audit->text($text);
    return $audit->toJson();
}

use Qvbilam\Audit\Audit;

public function auditTextInjection(Request $request)
{
    $text = $request->query("txt");
    return app("audit")->text($text)->toJson();
}