定制 cipemotion/medialibrary 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cipemotion/medialibrary

最新稳定版本:2.1.2

Composer 安装命令:

composer require cipemotion/medialibrary

包简介

A Laravel media library.

README 文档

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');
}

统计信息

  • 总下载量: 27.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 2

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-11