定制 sebastienheyd/boilerplate-media-manager 二次开发

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

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

sebastienheyd/boilerplate-media-manager

Composer 安装命令:

composer require sebastienheyd/boilerplate-media-manager

包简介

Media Manager for sebastienheyd/boilerplate

README 文档

README

Packagist StyleCI Laravel Nb downloads MIT License

This package adds a media management tool to sebastienheyd/boilerplate

Installation

  1. In order to install Laravel Boilerplate Media Manager run :
composer require sebastienheyd/boilerplate-media-manager
  1. Run the migration to add permissions
php artisan migrate
  1. Create the symbolic link from public/storage to storage/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 我们能提供哪些服务?
定制开发 / 二次开发

基于 sebastienheyd/boilerplate-media-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-13