PHPackages                             noin/clamav-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. noin/clamav-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

noin/clamav-validator
=====================

Custom Laravel 5 anti-virus validator for file uploads.

v1.0.1(1y ago)0623↓82%MITPHPPHP ^7.3|^8.0

Since Mar 6Pushed 1y agoCompare

[ Source](https://github.com/Tinnnooo/clamav-validator)[ Packagist](https://packagist.org/packages/noin/clamav-validator)[ Docs](https://github.com/Tinnnooo/clamav-validator)[ RSS](/packages/noin-clamav-validator/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

ClamAV Virus Validator For Laravel
==================================

[](#clamav-virus-validator-for-laravel)

[![SensioLabsInsight](https://camo.githubusercontent.com/ec6e5584ba95f53a0f2d907aaf3921f633ea050803d03f0576e76be87950a159/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f38306632383832352d313338352d346461612d616161642d3065346336623662333931302f6d696e692e706e67)](https://insight.sensiolabs.com/projects/80f28825-1385-4daa-aaad-0e4c6b6b3910)[![Code Coverage](https://camo.githubusercontent.com/63800be65db7e77d632913fa4e9b992d7d5d49a81f78c40a022c418ff39c13f4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73756e7370696b65732f636c616d61762d76616c696461746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sunspikes/clamav-validator/?branch=master)[![Code Quality](https://camo.githubusercontent.com/96f13ce2d326108f15d97a85cc48a1b7a5e1e334c3b46749b80105d8a0e0ed61/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73756e7370696b65732f636c616d61762d76616c696461746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/sunspikes/clamav-validator)[![Build Status](https://camo.githubusercontent.com/d1d9f8f07d4272d3b5914e11742c0cf25451f826fe11fceabd327ae05b56b2ab/68747470733a2f2f7472617669732d63692e6f72672f73756e7370696b65732f636c616d61762d76616c696461746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sunspikes/clamav-validator)[![Latest Stable Version](https://camo.githubusercontent.com/e4ccdd0fad31cd4474af573d7ff80e85e68164d7ff01173f60fa8635e8e545be/68747470733a2f2f706f7365722e707567782e6f72672f73756e7370696b65732f636c616d61762d76616c696461746f722f762f737461626c65)](https://packagist.org/packages/sunspikes/clamav-validator)[![License](https://camo.githubusercontent.com/0471e59a93176a0407580965a1577cfb37c313a975376034556b105e39a524d5/68747470733a2f2f706f7365722e707567782e6f72672f73756e7370696b65732f636c616d61762d76616c696461746f722f6c6963656e7365)](https://packagist.org/packages/sunspikes/clamav-validator)

A custom Laravel virus validator based on ClamAV anti-virus scanner for file uploads.

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Author](#author)

Requirements
------------

[](#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](http://www.clamav.net/documents/installing-clamav).

For example on an Ubuntu machine, you can do:

```
# Install clamav virus scanner
sudo apt-get update && sudo apt-get 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. You will also need to have `sockets` extension installed and enabled (all executions without this module will fail with this error - `"Use of undefined constant 'AF_INET'"`).

Installation
------------

[](#installation)

#### 1. Install the package through [Composer](http://getcomposer.org).

[](#1-install-the-package-through-composer)

```
$ composer require noin/clamav-validator
```

#### 2. Add the service provider (for Laravel 5.4 or below)

[](#2-add-the-service-provider-for-laravel-54-or-below)

This package supports Laravel new [Package Discovery](https://laravel.com/docs/5.5/packages#package-discovery).

If you are using Laravel &lt; 5.5, you need to add `Sunspikes\ClamavValidator\ClamavValidatorServiceProvider::class` to your `providers` array in `config/app.php`:

```
'providers' => [
	// ...

	Sunspikes\ClamavValidator\ClamavValidatorServiceProvider::class,
],
```

#### 3. Publish assets from the vendor package

[](#3-publish-assets-from-the-vendor-package)

##### Config file

[](#config-file)

The default configuration file does use `ENV` to override the defaults. If you want to change the configuration file anyway you run the following command to publish the package config file:

```
php artisan vendor:publish --provider="Sunspikes\ClamavValidator\ClamavValidatorServiceProvider" --tag=config

```

Once the command is finished you should have a `config/clamav.php` file that will be used as well.

##### Language files

[](#language-files)

If you want to customize the translation or add your own language you can run the following command to publish the language files to a folder you maintain:

```
php artisan vendor:publish --provider="Sunspikes\ClamavValidator\ClamavValidatorServiceProvider" --tag=lang

```

This will copy the language files to `resources/lang/vendor/clamav-validator` for Laravel &gt;= 5.1

Usage
-----

[](#usage)

Use it like any `Validator` rule:

```
$rules = [
    'file' => 'clamav',
];
```

`ClamavValidator` will automatically run multiple files one-by-one through ClamAV in case `file` represent multiple uploaded files.

Author
------

[](#author)

Krishnaprasad MG \[@sunspikes\] and other [awesome contributors](https://github.com/sunspikes/clamav-validator/graphs/contributors)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance41

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

486d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ad7c646e22d71a1bee2805f64223bff8744a3e87c5cafac1c2a785fb6ea310c?d=identicon)[Tinno](/maintainers/Tinno)

---

Top Contributors

[![sunspikes](https://avatars.githubusercontent.com/u/75611?v=4)](https://github.com/sunspikes "sunspikes (59 commits)")[![hordijk](https://avatars.githubusercontent.com/u/4454086?v=4)](https://github.com/hordijk "hordijk (2 commits)")[![tinno-sj](https://avatars.githubusercontent.com/u/177504008?v=4)](https://github.com/tinno-sj "tinno-sj (2 commits)")[![bnoordsij](https://avatars.githubusercontent.com/u/8420034?v=4)](https://github.com/bnoordsij "bnoordsij (1 commits)")[![chrisLeeTW](https://avatars.githubusercontent.com/u/1946961?v=4)](https://github.com/chrisLeeTW "chrisLeeTW (1 commits)")[![damyon](https://avatars.githubusercontent.com/u/758959?v=4)](https://github.com/damyon "damyon (1 commits)")[![GuusLeeuw-IGN](https://avatars.githubusercontent.com/u/60770713?v=4)](https://github.com/GuusLeeuw-IGN "GuusLeeuw-IGN (1 commits)")[![imgrant](https://avatars.githubusercontent.com/u/5815412?v=4)](https://github.com/imgrant "imgrant (1 commits)")[![Levivb](https://avatars.githubusercontent.com/u/2494320?v=4)](https://github.com/Levivb "Levivb (1 commits)")[![marksalmon](https://avatars.githubusercontent.com/u/7000886?v=4)](https://github.com/marksalmon "marksalmon (1 commits)")[![sbine](https://avatars.githubusercontent.com/u/1902973?v=4)](https://github.com/sbine "sbine (1 commits)")[![thiagobbt](https://avatars.githubusercontent.com/u/2956060?v=4)](https://github.com/thiagobbt "thiagobbt (1 commits)")[![tudorrrrrr](https://avatars.githubusercontent.com/u/60345215?v=4)](https://github.com/tudorrrrrr "tudorrrrrr (1 commits)")[![TullariS](https://avatars.githubusercontent.com/u/7660175?v=4)](https://github.com/TullariS "TullariS (1 commits)")[![aedart](https://avatars.githubusercontent.com/u/1523223?v=4)](https://github.com/aedart "aedart (1 commits)")[![vigneshgurusamy](https://avatars.githubusercontent.com/u/6076800?v=4)](https://github.com/vigneshgurusamy "vigneshgurusamy (1 commits)")[![ashleyshenton](https://avatars.githubusercontent.com/u/26444425?v=4)](https://github.com/ashleyshenton "ashleyshenton (1 commits)")[![bdelamatre](https://avatars.githubusercontent.com/u/3412927?v=4)](https://github.com/bdelamatre "bdelamatre (1 commits)")

---

Tags

laravelvalidatorvirusclamav

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/noin-clamav-validator/health.svg)

```
[![Health](https://phpackages.com/badges/noin-clamav-validator/health.svg)](https://phpackages.com/packages/noin-clamav-validator)
```

###  Alternatives

[sunspikes/clamav-validator

Custom Laravel anti-virus validator for file uploads using ClamAV.

3722.1M6](/packages/sunspikes-clamav-validator)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2462.4M7](/packages/laravel-validation-rules-credit-card)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.4M50](/packages/proengsoft-laravel-jsvalidation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
