PHPackages                             optimuscms/media - 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. optimuscms/media

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

optimuscms/media
================

v0.2(7y ago)022812MITPHP

Since Mar 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/optimuscms/media)[ Packagist](https://packagist.org/packages/optimuscms/media)[ RSS](/packages/optimuscms-media/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (2)

Media
=====

[](#media)

This package provides the core backend functionality within the CMS to upload media (image) files and organise them into folders.

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

[](#installation)

This package can be installed through Composer.

```
composer require optimuscms/media
```

In Laravel 5.5 and above the package will autoregister the service provider.

In Laravel 5.4 you must install this service provider:

```
// config/app.php
'providers' => [
    ...
    Optimus\Media\MediaServiceProvider::class,
    ...
];
```

API Routes
----------

[](#api-routes)

The API follows standard RESTful conventions, with responses being returned in JSON. Appropriate HTTP status codes are provided, and these should be used to check the outcome of an operation.

**Folders**

- [List folders](#folders-all)
- [Get folder](#folders-get)
- [Create folder](#folders-create)
- [Update folder](#folders-update)
- [Delete folder](#folders-delete)

**Media Items**

- [List media items](#media-all)
- [Get media item](#media-get)
- [Create media item](#media-create)
- [Update media item](#media-update)
- [Delete media item](#media-delete)

### List folders

[](#list-folders)

```
GET /admin/api/media-folders
```

List all available folders that media items can be added to.

**Parameters**

ParameterRequired?TypeDescriptionparent✗intA folder ID. When provided will only show folders nested inside this folder.**Example Response**

```
[
    {
        "id": 12,
        "parent_id": null,
        "name": "Product Images",
        "created_at": "2017-12-24 09:36:23",
        "updated_at": "2017-12-25 10:15:12"
    },
    {
        "id": 13,
        "parent_id": 12,
        "name": "Product Thumbnails",
        "created_at": "2019-02-19 09:36:23",
        "updated_at": "2019-02-19 09:36:23"
    }
]
```

### Get folder

[](#get-folder)

```
GET /admin/api/media-folders/{id}
```

Retrieve details for a specific folder.

**Parameters**

ParameterRequired?TypeDescriptionid✓intThe ID of the folder**Example Response**

```
{
    "id": 12,
    "parent_id": null,
    "name": "Product Images",
    "created_at": "2017-12-24 09:36:23",
    "updated_at": "2017-12-25 10:15:12"
}
```

### Update folder

[](#update-folder)

```
PUT/PATCH /admin/api/media-folders/{id}
```

Update the details of a folder.

**Parameters**

ParameterRequired?TypeDescriptionparent\_id✗intThe ID of the parent folder. Set to empty to move the folder into the rootname✗stringThe name of the folder**Example Response**

```
{
    "id": 12,
    "parent_id": null,
    "name": "Product Images",
    "created_at": "2017-12-24 09:36:23",
    "updated_at": "2017-12-25 10:15:12"
}
```

### Create folder

[](#create-folder)

```
POST /admin/api/media-folders
```

Create a new folder.

**Parameters**

ParameterRequired?TypeDescriptionparent\_id✓intThe ID of the parent folder. Set to null to move the folder into the rootname✓stringThe name of the folder**Example Response**

```
{
    "id": 12,
    "parent_id": null,
    "name": "Product Images",
    "created_at": "2017-12-24 09:36:23",
    "updated_at": "2017-12-25 10:15:12"
}
```

### Delete folder

[](#delete-folder)

```
DELETE /admin/api/media-folders/{id}
```

Delete a folder.

**Parameters**

ParameterRequired?TypeDescriptionid✓intThe ID of the folder**Example Response**

The HTTP status code will be 204 if successful.

### List media items

[](#list-media-items)

```
GET /admin/api/media
```

List available media items.

**Parameters**

ParameterRequired?TypeDescriptionfolder✗intFolder ID. When provided will only show media items from this folder.**Example Response**

```
[
    {
        "id": 356,
        "folder_id": 12,
        "name": "My Image",
        "file_name": "my_image.jpg",
        "disk": "local",
        "mime_type": "image/jpeg",
        "size": 102400,
        "created_at": "2017-12-24 09:36:23",
        "updated_at": "2017-12-25 10:15:12"
    },
    {
        "id": 513,
        "folder_id": 4,
        "name": "Landscape",
        "file_name": "landscape.png",
        "disk": "local",
        "mime_type": "image/png",
        "size": 219462,
        "created_at": "2019-02-19 09:36:23",
        "updated_at": "2019-02-19 09:36:23"
    }
]
```

### Get media item

[](#get-media-item)

```
GET /admin/api/media/{id}
```

Retrieve details of a specific media item.

**Parameters**

ParameterRequired?TypeDescriptionid✓intThe ID of the media item**Example Response**

```
{
    "id": 513,
    "folder_id": 4,
    "name": "Landscape",
    "file_name": "landscape.png",
    "disk": "local",
    "mime_type": "image/png",
    "size": 219462,
    "created_at": "2019-02-19 09:36:23",
    "updated_at": "2019-02-19 09:36:23"
}
```

### Update media item

[](#update-media-item)

```
PUT/PATCH /admin/api/media/{id}
```

Update the details of a single media item.

**Parameters**

ParameterRequired?TypeDescriptionname✗stringA user-facing name for the media itemfolder\_id✗intThe ID of the folder in which to store the media. If an empty value is provided, the media will be moved into the root folder.**Example Response**

```
{
    "id": 513,
    "folder_id": 4,
    "name": "Landscape",
    "file_name": "landscape.png",
    "disk": "local",
    "mime_type": "image/png",
    "size": 219462,
    "created_at": "2019-02-19 09:36:23",
    "updated_at": "2019-02-19 09:36:23"
}
```

### Create media item

[](#create-media-item)

```
POST /admin/api/media
```

Create and store a new media item.

**Parameters**

ParameterRequired?TypeDescriptionfile✓fileThe file that is being uploadedfolder\_id✗intThe ID of the folder in which to store the media. If not provided, the media will be stored in the root folder.**Example Response**

```
{
    "id": 513,
    "folder_id": 4,
    "name": "Landscape",
    "file_name": "landscape.png",
    "disk": "local",
    "mime_type": "image/png",
    "size": 219462,
    "created_at": "2019-02-19 09:36:23",
    "updated_at": "2019-02-19 09:36:23"
}
```

### Delete media item

[](#delete-media-item)

```
DELETE /admin/api/media/{id}
```

Delete a media item.

**Parameters**

ParameterRequired?TypeDescriptionid✓intThe ID of the media item to delete**Example Response**

The HTTP status code will be 204 if successful.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72% 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 ~53 days

Total

2

Last Release

2572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c751a806a8c52afaca5c461326a0799033af6dc94f9ff1f4ee767565d7f83b7?d=identicon)[optimuscms](/maintainers/optimuscms)

---

Top Contributors

[![Jack97](https://avatars.githubusercontent.com/u/19285044?v=4)](https://github.com/Jack97 "Jack97 (18 commits)")[![r1chm8](https://avatars.githubusercontent.com/u/25925437?v=4)](https://github.com/r1chm8 "r1chm8 (4 commits)")[![callumbloomfield](https://avatars.githubusercontent.com/u/6523594?v=4)](https://github.com/callumbloomfield "callumbloomfield (3 commits)")

### Embed Badge

![Health badge](/badges/optimuscms-media/health.svg)

```
[![Health](https://phpackages.com/badges/optimuscms-media/health.svg)](https://phpackages.com/packages/optimuscms-media)
```

###  Alternatives

[overtrue/laravel-filesystem-qiniu

A Qiniu storage filesystem for Laravel.

482229.7k16](/packages/overtrue-laravel-filesystem-qiniu)[rahulhaque/laravel-filepond

Use FilePond the Laravel way

261114.4k2](/packages/rahulhaque-laravel-filepond)[overtrue/laravel-filesystem-cos

A Cos storage filesystem for Laravel.

92128.4k7](/packages/overtrue-laravel-filesystem-cos)

PHPackages © 2026

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