moirei/media-library
Composer 安装命令:
composer require moirei/media-library
包简介
Manage media library with a directory system and associate files with Eloquent models.
关键字:
README 文档
README
Laravel application media content management made easy.
Documentation
All documentation is available at the documentation site.
💚 Features
- Image URL manipulation: manipulate uploaded images with Cloud Image compatible API for your responsive frontend
- Eloquent models: associate files with Eloquent models. Attach different file types (video, images) to different model attributes with polymorphic many-to-many while having the ability to fully configure model-specific uploads.
- Secure: public, signed, and protected endpoints and file sharing and downloads regardless of storage disk. Includes configurable middleware per API endpoints for fine-grained permissions and authorization
- File sharing: securely share files a directories with anyone. Including none registered users.
- Uploads: upload by external URL, local path, File or request UploadFile. The package exposes internal API endpoints for uploads, downloads, streams and other admin operations
- Control: control uploads and shared files by types, size, size per type
- Responsive images: automatically resize images on uploads for responsive frontend
- Storage system: provides media storage namespacing for multi-tenant and multi-domain uploads with varying configurations.
- Rich text attachments: seamlessly management attachments and integrate model text fields
... use MOIREI\MediaLibrary\Casts\AsMediaItem; use MOIREI\MediaLibrary\Casts\AsMediaItems; use MOIREI\MediaLibrary\Traits\InteractsWithMedia; class Product extends Model { use InteractsWithMedia; $casts = [ 'image' => AsMediaItem::class, 'gallery' => AsMediaItems::class, ]; ... } ... $video = File::find('video-file-id'); $product = Product::create([ 'name' => 'MOIREI MP202+', 'image' => 'image-file-id1', 'gallery' => ['image-file-id2', $video], ]);
Installation
composer require moirei/media-library
Publish the config
php artisan vendor:publish --tag=media-library-config
Prepare the database
php artisan vendor:publish --tag=media-library-migrations
Then run the migrations
php artisan migrate
Changelog
Please see CHANGELOG.
Credits
- This package was inspired by classic-o/nova-media-library, an excellent package for Laravel Nova
- Augustus Okoye
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 505
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-30