Looking to hire Laravel developers? Try LaraJobs

laravel-clamav maintained by crys

Description
ClamAV integration for Laravel 5.5+
Author
Last update
2018/07/03 16:37 (dev-master)
License
Downloads
747

Comments
comments powered by Disqus

ClamAV integration for Laravel 5.5+

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.