crys / laravel-clamav
ClamAV integration for Laravel 5.5+
Requires
- php: >=7.0.0
- illuminate/support: >=5.5.0
- illuminate/validation: >=5.5.0
- xenolope/quahog: 2.*
This package is not auto-updated.
Last update: 2021-03-13 18:39:30 UTC
README
Custom Laravel 5 anti-virus validator for file uploads.
Requirements
You must have ClamAV anti-virus scanner running on the server to make this package work.
You can see the ClamAV installation instructions on the official ClamAV documentation.
For example on an Ubuntu machine, you can do:
# Install clamav virus scanner sudo apt update && apt install -y clamav-daemon # Update virus definitions sudo freshclam # Start the scanner service sudo systemctl enable --now clamav-daemon clamav-freshclam
This package is not tested on windows, but if you have ClamAV running (usually on port 3310) it should work.
Installation
Install the package through Composer.
Run composer require crys/laravel-clamav
Add the following to your providers
array in config/app.php
:
'providers' => [ // ... Crys\Clamav\ServiceProvider::class, ],
Usage
Use it like any Validator
rule:
$rules = [ 'my_file_field' => 'clamav', ];
Configuration
By default the package will try to connect the clamav daemon via the default unix socket (/var/run/clamav/clamd.ctl
)
But you can set the CLAMAV_HOST
environment variable to override this.