cipemotion/medialibrary

A Laravel media library.
30,365 5
Install
composer require cipemotion/medialibrary
Latest Version:2.1.2
PHP:>=7.1
Laravel:5 – 12
License:MIT
Last Updated:Oct 30, 2025
Links: GitHub  ·  Packagist
Maintainer: stayallive

CipeMotion Media Library

A media library package making it easy to implement your own WordPress style media picker component.

This package depends on intervention/image.

Configuration

Add the service providers to your providers array in app.php.

CipeMotion\Medialibrary\ServiceProvider::class,
Intervention\Image\ImageServiceProvider::class

Optional: Add the intervention/image Facade to the aliases array in app.php.

'Image' => Intervention\Image\Facades\Image::class,

Publish the config file:

php artisan vendor:publish --provider="CipeMotion\Medialibrary\ServiceProvider" --tag="config"

Read through the config file and change what is needed.

Database

Publish the migrations file:

php artisan vendor:publish --provider="CipeMotion\Medialibrary\ServiceProvider" --tag="migrations"

Run the migrations:

php artisan migrate

Relations

On your owner model add:

public function files()
{
    return $this->hasMany(\CipeMotion\Medialibrary\Entities\File::class, 'owner_id');
}

On your models add:

public function attachebles()
{
    return $this->morphToMany(\CipeMotion\Medialibrary\Entities\File::class, 'attachable', 'medialibrary_attachable');
}

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
2.1.2 >=7.1 ^5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
2.1.1 >=7.1 ^5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
2.1.0 >=7.1 ^5.3|^6.0|^7.0|^8.0|^9.0 MIT
2.0.3 >=7.1 ^5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT
2.0.2 >=7.1 ^5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0 MIT