PHP code example of overtrue / laravel-qcloud-content-audit
1. Go to this page and download the library: Download overtrue/laravel-qcloud-content-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/ */
overtrue / laravel-qcloud-content-audit example snippets
use Illuminate\Database\Eloquent\Model;
use Overtrue\LaravelQcloudContentAudit\Traits\CheckTextWithTms;
class Post extends Model
{
// 文本校验
use CheckTextWithTms;
protected array $tmsCheckable = ['name', 'description'];
protected string $tmsCheckStrategy = 'strict'; // 可选,默认使用最严格模式
//...
}
use Illuminate\Database\Eloquent\Model;
use Overtrue\LaravelQcloudContentAudit\Traits\MaskTextWithTms;
class Post extends Model
{
use MaskTextWithTms;
protected $tmsMaskable = ['name', 'description'];
// protected $tmsMaskStrategy = 'strict'; // 开启打码的策略情况,可选,默认使用最严格模式
//...
}