PHPackages                             timnarr/kirby-sanitize-filenames - 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. timnarr/kirby-sanitize-filenames

AbandonedArchivedKirby-plugin[Validation &amp; Sanitization](/categories/validation)

timnarr/kirby-sanitize-filenames
================================

This plugin provides filename sanitizing by using file hooks.

0.2.0(2y ago)16MITPHPPHP &gt;=8.0.0

Since Nov 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/timnarr/kirby-sanitize-filenames)[ Packagist](https://packagist.org/packages/timnarr/kirby-sanitize-filenames)[ Docs](https://github.com/timnarr/kirby-sanitize-filenames)[ RSS](/packages/timnarr-kirby-sanitize-filenames/feed)WikiDiscussions main Synced 1mo ago

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

Kirby Sanitize Filenames
========================

[](#kirby-sanitize-filenames)

**Sanitize Filenames for Kirby CMS** – This plugin automatically transforms and sanitizes filenames using file hooks. It can converts filenames to `snake_case` or `kebab-case`. It also sanitizes filenames by modifying special characters and allows adding a custom prefix for consistent file naming.

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

[](#installation)

### Download

[](#download)

Download and copy this repository to `/site/plugins/kirby-sanitize-filenames`.

### Composer

[](#composer)

```
composer require timnarr/kirby-sanitize-filenames

```

Usage
-----

[](#usage)

The plugin listens for these two Kirby hooks, and when these are triggered, the filename gets manipulated:

- `file.create:after`
- `file.replace:after`

This plugin does not support the `changeName` hook because file renaming, which occurs after the `create` and `replace` hooks, will trigger the `changeName` hook too. This could lead to some misbehaviors. However, it is beneficial to be able to change the filename after the initial upload and filename manipulation.

Config
------

[](#config)

You can choose between `snake` and `kebab` style. The prefix will also be transformed to a [safe-name](https://github.com/getkirby/kirby/tree/3.9.8/src/Filesystem/F.php#L741) and a delimiter gets appended: `_` for snake and `-` for kebab style.

```
'timnarr.sanitize-filenames' => [
  'caseStyle' => 'snake',
  'prefix' => 'timnarr'
]
```

License
-------

[](#license)

[MIT License](./LICENSE) Copyright © 2023 Tim Narr

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

909d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75cefc2df4ef7934de03eae279eadce11b87ebf6252019a643a626327e887ef5?d=identicon)[TimNarr](/maintainers/TimNarr)

---

Top Contributors

[![timnarr](https://avatars.githubusercontent.com/u/3532570?v=4)](https://github.com/timnarr "timnarr (5 commits)")

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/timnarr-kirby-sanitize-filenames/health.svg)

```
[![Health](https://phpackages.com/badges/timnarr-kirby-sanitize-filenames/health.svg)](https://phpackages.com/packages/timnarr-kirby-sanitize-filenames)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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