directorytree/privacy-filter-classifier
privacy-filter.cpp). This aligns with Laravel applications requiring data anonymization, compliance (GDPR/CCPA), or automated redaction (e.g., logs, user-generated content, or support tickets).privacy-filter.cpp) and model file (.gguf), introducing operational complexity (model storage, updates, and binary management). This may conflict with Laravel’s composer-centric ecosystem if the binary requires platform-specific dependencies (e.g., Linux-only).composer require. No Laravel-specific hooks or service providers are required, but configuration management (binary/model paths) will need custom handling.php artisan privacy:scan).HandlePrivacyRedaction).saving a Comment or Ticket).ClassifyTextJob) for performance.f16.gguf → f32.gguf) require manual updates and potential downtime.PrivacyFilterBinaryFailedException).try-catch and log failures with context (e.g., input text, binary path).config/privacy-filter.php) and A/B test in staging.privacy-filter.cpp binary pre-installed? If not, how will it be distributed (Docker, CI, manual)?$this->app->singleton(Classifier::class, function ($app) {
return new Classifier(
binaryPath: config('privacy-filter.binary_path'),
modelPath: config('privacy-filter.model_path'),
timeout: config('privacy-filter.timeout', 60)
);
});
config/privacy-filter.php:
return [
'binary_path' => env('PRIVACY_FILTER_BINARY_PATH', '/usr/local/bin/privacy-filter'),
'model_path' => storage_path('app/models/privacy-filter-f16.gguf'),
'threshold' => 0.85,
];
.env for dynamic paths (e.g., PRIVACY_FILTER_BINARY_PATH=/custom/path).pii_entities table with metadata (e.g., text, entity_type, confidence, created_at).Schema::create('pii_entities', function (Blueprint $table) {
$table->id();
$table->text('text');
$table->string('entity_type'); // e.g., 'email', 'phone'
$table->decimal('confidence', 5, 2);
$table->morphs('classifiable'); // Polymorphic relation to original model
$table->timestamps();
});
HasPiiClassification).trait HasPiiClassification {
public function classifyText(string $text): array {
return app(Classifier::class)->entities($text);
}
}
README (e.g., "Requires privacy-filter.cpp v1.2+").config/privacy-filter.php.App\Services\PiiClassifier).Log facade).privacy-filter.cpp or models may break functionality.privacy-filter-v1.0.0.gguf).privacy-filter.cpp repository for breaking changes..env overrides).symfony/process to inspect the binary’s output:
$process = new Process(['/path/to/privacy-filter', '--help']);
$process->run();
file_put_contents(storage_path('logs/privacy
How can I help you explore Laravel packages today?