PHPackages                             piko/medias-module - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. piko/medias-module

ActiveLibrary[File &amp; Storage](/categories/file-storage)

piko/medias-module
==================

Piko medias management module.

v1.2.7(today)08↑2900%LGPL-3.0PHP

Since Jun 26Pushed todayCompare

[ Source](https://github.com/piko-framework/medias-module)[ Packagist](https://packagist.org/packages/piko/medias-module)[ RSS](/packages/piko-medias-module/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (12)Versions (11)Used By (0)

Piko medias module
==================

[](#piko-medias-module)

Medias management module for [Piko](https://piko-framework.github.io/) based projects.

This module uses the UI Component [Upload Manager](https://github.com/ilhooq/upload-manager)

[![Upload Manager UI](https://github.com/ilhooq/upload-manager/raw/main/example/screenshot.png)](https://github.com/ilhooq/upload-manager/raw/main/example/screenshot.png);

Features
--------

[](#features)

- **Upload Manager UI integration**: ships with a ready-to-use widget (`UploadManagerWidget`) and bundled JS/CSS assets.
- **Admin-protected media API**: all upload-manager endpoints are restricted to users with `manage.medias` permission.
- **Complete media workflow**: upload, list, update metadata (caption/order), reorder, and delete media through dedicated routes.
- **Entity-aware media grouping**: files are organized by `category` and `ref_id` to attach medias to any domain entity.
- **Secure upload handling**: sanitized filenames + configurable upload size limit via `maxFileSize`.
- **On-demand thumbnail generation**: automatic thumbnail caching for images with configurable `thumbnailQuality` and JPEG/WebP/AVIF output.
- **Automatic filesystem cleanup**: deleting a media record also removes its physical file.
- **Database-backed persistence**: each uploaded file is stored on disk and tracked in the `media` table.
- **Built-in installer command**: includes SQL install scripts and CLI setup (`./vendor/bin/medias-module setup:install`).
- **I18n-ready API messages**: validation and method errors can be translated through the `medias` domain.

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

[](#installation)

1 - Install module via composer:

```
composer require piko/medias-module
```

2 - Edit your Piko config :

```
[
  'modules' => [
    // ...
    'medias' => [
      'class' => 'Piko\MediasModule',
      'maxFileSize' => 10 * 1024 * 1024, // 10Mo
      'thumbnailQuality' => 95,
      'managePermission' => 'admin',
    ],
  ],
  'bootstrap' => ['medias'],
]
```

3 - Install the media table.

```
export DSN=mysql:host=127.0.0.1;dbname=yourdatabase;charset=utf8mb4
export DB_USERNAME=mysqluser
export DB_PASSWORD=yourpassword

./vendor/bin/medias-module setup:install
```

Usage in a PHP view template
----------------------------

[](#usage-in-a-php-view-template)

Example in a Piko view file (for example `views/post/edit.php`):

```

Post medias

```

> `refId` should be the related entity ID, and `category` lets you isolate medias by context (e.g. `post`, `product`, `user`).

Routes
------

[](#routes)

- **/medias/upload-manager/upload** : POST - file upload endpoint
- **/medias/upload-manager/list** : GET - list medias
- **/medias/upload-manager/update** : PATCH - update media
- **/medias/upload-manager/reorder** : POST - reorder medias
- **/medias/upload-manager/delete** : DELETE - delete a media

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

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

10

Last Release

0d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/001b70c85d853a2aae5f1bf74a1ff7ad77ffcec2d423090d67293bde99158350?d=identicon)[ilhooq](/maintainers/ilhooq)

---

Top Contributors

[![ilhooq](https://avatars.githubusercontent.com/u/1500886?v=4)](https://github.com/ilhooq "ilhooq (17 commits)")

---

Tags

modulemediaspikoupload manager

###  Code Quality

TestsCodeception

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/piko-medias-module/health.svg)

```
[![Health](https://phpackages.com/badges/piko-medias-module/health.svg)](https://phpackages.com/packages/piko-medias-module)
```

###  Alternatives

[noam148/yii2-image-manager

A Yii2 module/widget for upload and cropping images

12914.9k](/packages/noam148-yii2-image-manager)

PHPackages © 2026

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