sebastienheyd/boilerplate-media-manager
Composer 安装命令:
composer require sebastienheyd/boilerplate-media-manager
包简介
Media Manager for sebastienheyd/boilerplate
README 文档
README
This package adds a media management tool to sebastienheyd/boilerplate
Installation
- In order to install Laravel Boilerplate Media Manager run :
composer require sebastienheyd/boilerplate-media-manager
- Run the migration to add permissions
php artisan migrate
- Create the symbolic link from
public/storagetostorage/app/public
php artisan storage:link
Optional:
To publish configuration files, you can run:
php artisan vendor:publish --tag=boilerplate
Configuration
After vendor:publish, you can find the configuration file mediamanager.php in the app/config/boilerplate folder
| configuration | description |
|---|---|
| mediamanager.base_url | Relative path to the public storage folder |
| mediamanager.tinymce_upload_dir | Directory where TinyMCE will store his edited image |
| mediamanager.thumbs_dir | Directory where to store dynamically generated thumbs |
| mediamanager.authorized.size | Upload max size in bytes, default is 2048 |
| mediamanager.authorized.mimes | Mime types by extension, see Laravel documentation |
| mediamanager.filetypes | Associative array to get file type by extension |
| mediamanager.icons | Associative array to get icon class (Fontawesome) by file type |
| mediamanager.filter | Array of filtered files to hide |
Backend
TinyMCE
This media manager will be automatically used for images and files inclusion by the TinyMCE Blade component included with the sebastienheyd/boilerplate package.
Image selector
You can use the <x-boilerplate-media-manager::image> component to easily insert an image selector into your forms.
This component allows you to use the media manager to select an image to use.
<x-boilerplate-media-manager::image name="image">
Parameters are :
| name | description | default |
|---|---|---|
| name | Input name (required) | "" |
| value | Default input value | "" |
| label | Label of the input field | "" |
| width | Width of the selector | 300 |
| height | Height of the selector | 200 |
| help | Help text | "" |
| group-class | Additional class to form-group | "" |
| group-id | Form-group ID | "" |
File selector
You can use the <x-boilerplate-media-manager::file> component to easily insert a file selector into your forms.
This component allows you to use the media manager to select a file to assign to the input field.
<x-boilerplate-media-manager::file name="file">
Parameters are :
| name | description | default |
|---|---|---|
| name | Input name (required) | "" |
| value | Input value | "" |
| label | Label of the input field | "" |
| type | Media list filter (all, file, image, video) | all |
| help | Help text | "" |
| group-class | Additional class to form-group | "" |
| group-id | Form-group ID | "" |
Frontend
Img (fit or resize)
img will dynamically resize an image and returns the URL using Intervention and Storage (public disk)
{!! img('/storage/my_picture.jpg', 100, 100, [], 'resize') !!}
will return
<img src="/storage/thumbs/resize/100x100/my_picture.jpg?1555331285" width="100" height="100">
Or using the @img Blade directive :
@img('/storage/my_picture.jpg', 250, 150, ['class' => 'fluid-image'])
will return
<img src="/storage/thumbs/fit/250x150/my_picture.png?1555331285" width="250" height="150" class="fluid-image">
You can already get only the url by using img_url helper function.
Clear cache
You can clear all resized image by using the artisan command thumbs:clear
php artisan thumbs:clear
Language
You can translate or change translations by running php artisan vendor:publish --tag=boilerplate-media-manager-lang.
After running this command, you will find translations folders into resources/lang/vendor/boilerplate-media-manager.
Copy one of the language folders in the new language you want to create and all you have to do is to translate. If you
want to share the language you have added, don't hesitate to make a pull request.
Views
You can override views by running php artisan vendor:publish --tag=boilerplate-media-manager-views. You will then find
the views in the resources/views/vendor/boilerplate-media-manager folder.
sebastienheyd/boilerplate-media-manager 适用场景与选型建议
sebastienheyd/boilerplate-media-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.65k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2019 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「media」 「file」 「plugin」 「library」 「manager」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sebastienheyd/boilerplate-media-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sebastienheyd/boilerplate-media-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sebastienheyd/boilerplate-media-manager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
Laravel Media Popup to upload/view the files
PMVC Plugin for File information
Mapper for accessing resources in KWCMS
统计信息
- 总下载量: 3.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 9
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-13