Download the PHP package optimuscms/media without Composer
On this page you can find all versions of the php package optimuscms/media. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package media
Media
This package provides the core backend functionality within the CMS to upload media (image) files and organise them into folders.
Installation
This package can be installed through Composer.
In Laravel 5.5 and above the package will autoregister the service provider.
In Laravel 5.4 you must install this service provider:
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
- Get folder
- Create folder
- Update folder
- Delete folder
Media Items
- List media items
- Get media item
- Create media item
- Update media item
- Delete media item
List folders
List all available folders that media items can be added to.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
parent | ✗ | int | A folder ID. When provided will only show folders nested inside this folder. |
Example Response
Get folder
Retrieve details for a specific folder.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
id | ✓ | int | The ID of the folder |
Example Response
Update folder
Update the details of a folder.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
parent_id | ✗ | int | The ID of the parent folder. Set to empty to move the folder into the root |
name | ✗ | string | The name of the folder |
Example Response
Create folder
Create a new folder.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
parent_id | ✓ | int | The ID of the parent folder. Set to null to move the folder into the root |
name | ✓ | string | The name of the folder |
Example Response
Delete folder
Delete a folder.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
id | ✓ | int | The ID of the folder |
Example Response
The HTTP status code will be 204 if successful.
List media items
List available media items.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
folder | ✗ | int | Folder ID. When provided will only show media items from this folder. |
Example Response
Get media item
Retrieve details of a specific media item.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
id | ✓ | int | The ID of the media item |
Example Response
Update media item
Update the details of a single media item.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
name | ✗ | string | A user-facing name for the media item |
folder_id | ✗ | int | The 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
Create media item
Create and store a new media item.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
file | ✓ | file | The file that is being uploaded |
folder_id | ✗ | int | The ID of the folder in which to store the media. If not provided, the media will be stored in the root folder. |
Example Response
Delete media item
Delete a media item.
Parameters
Parameter | Required? | Type | Description |
---|---|---|---|
id | ✓ | int | The ID of the media item to delete |
Example Response
The HTTP status code will be 204 if successful.
License
The MIT License (MIT). Please see License File for more information.