crys/laravel-clamav

This package is abandoned and no longer maintained. The author suggests using the sunspikes/clamav-validator package instead.

ClamAV integration for Laravel 5.5+

v2.0.0 2018-07-03 14:37 UTC

This package is not auto-updated.

Last update: 2021-03-13 18:39:30 UTC


README

Latest Stable Version License

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.