{"id":13828164,"url":"https://github.com/sunspikes/clamav-validator","last_synced_at":"2026-04-02T13:26:52.469Z","repository":{"id":24152349,"uuid":"27542079","full_name":"sunspikes/clamav-validator","owner":"sunspikes","description":"Laravel virus validator based on ClamAV anti-virus scanner","archived":false,"fork":false,"pushed_at":"2026-03-25T09:32:06.000Z","size":90,"stargazers_count":364,"open_issues_count":12,"forks_count":74,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-03-26T12:57:09.865Z","etag":null,"topics":["clamav","laravel","laravel-package","php","validator"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunspikes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-12-04T13:39:00.000Z","updated_at":"2026-03-25T09:31:07.000Z","dependencies_parsed_at":"2024-03-18T10:28:15.622Z","dependency_job_id":"93f5bbcc-05dc-4341-9478-29d62653c794","html_url":"https://github.com/sunspikes/clamav-validator","commit_stats":{"total_commits":73,"total_committers":16,"mean_commits":4.5625,"dds":0.2191780821917808,"last_synced_commit":"0db18646b73afbd5094876f48a49e28a9a1426ed"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/sunspikes/clamav-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunspikes%2Fclamav-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunspikes%2Fclamav-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunspikes%2Fclamav-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunspikes%2Fclamav-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunspikes","download_url":"https://codeload.github.com/sunspikes/clamav-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunspikes%2Fclamav-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31307066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clamav","laravel","laravel-package","php","validator"],"created_at":"2024-08-04T09:02:34.940Z","updated_at":"2026-04-02T13:26:52.457Z","avatar_url":"https://github.com/sunspikes.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# ClamAV Virus Validator For Laravel\n\n[![Code Coverage](https://scrutinizer-ci.com/g/sunspikes/clamav-validator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/sunspikes/clamav-validator/?branch=master)\n[![Code Quality](https://scrutinizer-ci.com/g/sunspikes/clamav-validator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/sunspikes/clamav-validator)\n[![Latest Stable Version](https://poser.pugx.org/sunspikes/clamav-validator/v/stable)](https://packagist.org/packages/sunspikes/clamav-validator)\n[![License](https://poser.pugx.org/sunspikes/clamav-validator/license)](https://packagist.org/packages/sunspikes/clamav-validator)\n\nA custom Laravel virus validator based on ClamAV anti-virus scanner for file uploads.\n\n* [Requirements](#requirements)\n* [Installation](#installation)\n* [Configuration](#configuration)\n* [Usage](#usage)\n* [Author](#author)\n\n\u003ca name=\"requirements\"\u003e\u003c/a\u003e\n## Requirements\n\n- PHP \u003e= 8.0\n- Laravel 9.x, 10.x, 11.x, 12.x, or 13.x\n- ClamAV anti-virus scanner running on the server\n\nYou can see the ClamAV installation instructions on the official [ClamAV documentation](http://www.clamav.net/documents/installing-clamav).\n\nFor example on an Ubuntu machine, you can do:\n\n```sh\n# Install clamav virus scanner\nsudo apt-get update \u0026\u0026 sudo apt-get install -y clamav-daemon\n\n# Update virus definitions\nsudo freshclam\n\n# Start the scanner service\nsudo systemctl enable --now clamav-daemon clamav-freshclam\n```\n\nThis package is not tested on Windows, but if you have ClamAV running (usually on port 3310) it should work.\nYou 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'\"`).\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\n\n#### 1. Install the package through [Composer](http://getcomposer.org).\n\n   ```bash\n   composer require sunspikes/clamav-validator\n   ```\n\n#### 2. Publish assets from the vendor package\n\n##### Config file\n\nThe default configuration file does use `ENV` to override the defaults. If you want to change the configuration file\nanyway you run the following command to publish the package config file:\n\n    php artisan vendor:publish --provider=\"Sunspikes\\ClamavValidator\\ClamavValidatorServiceProvider\" --tag=config\n\nOnce the command is finished you should have a `config/clamav.php` file that will be used as well.\n\n##### Language files\n\nIf you want to customize the translation or add your own language you can run the following command to\npublish the language files to a folder you maintain:\n\n    php artisan vendor:publish --provider=\"Sunspikes\\ClamavValidator\\ClamavValidatorServiceProvider\" --tag=lang\n\nThis will copy the language files to `lang/vendor/clamav-validator`.\n\n\u003ca name=\"configuration\"\u003e\u003c/a\u003e\n## Configuration\n\nThe package can be configured using environment variables:\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `CLAMAV_PREFERRED_SOCKET` | `unix_socket` | Socket type: `unix_socket` or `tcp_socket` |\n| `CLAMAV_UNIX_SOCKET` | `/var/run/clamav/clamd.ctl` | Path to the ClamAV unix socket |\n| `CLAMAV_TCP_SOCKET` | `tcp://127.0.0.1:3310` | TCP socket connection string |\n| `CLAMAV_SOCKET_CONNECT_TIMEOUT` | `null` | Connection timeout in seconds (`null` = no limit) |\n| `CLAMAV_SOCKET_READ_TIMEOUT` | `30` | Read timeout in seconds |\n| `CLAMAV_CLIENT_EXCEPTIONS` | `false` | Throw exceptions on scan failures instead of returning validation failure |\n| `CLAMAV_SKIP_VALIDATION` | `false` | Skip virus scanning entirely (useful for local development) |\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\n\nUse it like any `Validator` rule:\n\n```php\n$rules = [\n    'file' =\u003e 'required|file|clamav',\n];\n```\n\nOr in a Form Request:\n\n```php\nclass UploadRequest extends FormRequest\n{\n    public function rules(): array\n    {\n        return [\n            'file' =\u003e 'required|file|clamav',\n        ];\n    }\n}\n```\n\n`ClamavValidator` will automatically run multiple files one-by-one through ClamAV in case `file` represents multiple uploaded files.\n\n\u003ca name=\"author\"\u003e\u003c/a\u003e\n## Author\n\nKrishnaprasad MG [@sunspikes] and other [awesome contributors](https://github.com/sunspikes/clamav-validator/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunspikes%2Fclamav-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunspikes%2Fclamav-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunspikes%2Fclamav-validator/lists"}