cipemotion / medialibrary
A Laravel media library.
2.1.2
2025-10-30 11:00 UTC
Requires
- php: >=7.1
- cloudconvert/cloudconvert-php: ^2.2|^3.2
- guzzlehttp/guzzle: ^6.0|^7.0
- intervention/image: ^2.3
- laravel/framework: ^5.3|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
- ramsey/uuid: ^3.5|^4.0
- statamic/stringy: ^2.8|^3.0
Requires (Dev)
- aws/aws-sdk-php: ^3.19
Suggests
- aws/aws-sdk-php: To use the S3PresignedUrlGenerator.
This package is auto-updated.
Last update: 2026-05-29 01:01:30 UTC
README
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');
}