bubnov/tissue
Scan uploaded files for viruses in PHP via adapter-based integrations. Includes a ClamAV adapter to run ClamAV scans and report infected files, helping you add antivirus checks to your upload pipeline (keep signatures updated; follow upload security best practices).
ClamAvAdapter) aligns well with Laravel’s dependency injection and interface-driven architecture. This enables easy swapping of scanning engines (e.g., for testing or future extensions).VirusScanner::scan()).VirusScanner::scan($filePath)) simplifies API calls, reducing boilerplate in controllers or services.file.uploaded) to trigger scans automatically, leveraging the event system for decoupled workflows.ScanFileJob) to avoid blocking HTTP requests, improving responsiveness.freshclam updates, sandboxing).spatie/laravel-virus-scanner)?scans table.)app()->bind(VirusScanner::class, fn() => new ClamAvAdapter())).VirusScanner facade for concise syntax (e.g., VirusScanner::scan($file)).file.uploaded or file.stored events using Laravel’s event system.HandleIncomingRequest).storage/app/uploads using temporary copies.ScanFileJob extending ShouldQueue).php-clamav (PHP extension) as an alternative if available.sudo apt-get install clamav).freshclam for automatic signature updates.freshclam.StoreFileRequest).scans table in DB).freshclam updates via cron.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| ClamAV service down | Uploads blocked | Fallback to lighter checks or queue scans. |
| Outdated signatures | New malware slips through | Automate freshclam updates; monitor signature dates. |
| False positives | Legitimate files rejected | Manual review workflow; whitelist known-safe files. |
| High scan latency | Slow uploads | Cache results; use async queues. |
| Package |
How can I help you explore Laravel packages today?