定制 halimtuhu/array-images 二次开发

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

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

halimtuhu/array-images

最新稳定版本:1.1

Composer 安装命令:

composer require halimtuhu/array-images

包简介

A Laravel Nova field for distribute your images as array of object.

README 文档

README

A laravel nova field that will let you save your uploaded images path to your database in array format.

Installation

composer require halimtuhu/array-images

Usage

Create array images just call Halimtuhu\ArrayImages\ArrayImages class and use make static method to create a field.

...
use Halimtuhu\ArrayImages\ArrayImages;
...
public function fields(Request $request)
    {
        return [
            ...
            ArrayImages::make('Images', 'images'),
            ...
        ];
    }
...

That will create a field with name Images. Stored data will look like this.

[{
    "url": "http://laranov.halimtuhu.test/storage/wB04AbprHGxHw4I3sizXmuw9L4LBcG0wv0QEacAo.jpeg",
    "name": "wB04AbprHGxHw4I3sizXmuw9L4LBcG0wv0QEacAo.jpeg"
}, {
    "url": "http://laranov.halimtuhu.test/storage/eOuxUCjHGNokkHdOXYB7gGObxCvf7m30ridFpBpy.jpeg",
    "name": "eOuxUCjHGNokkHdOXYB7gGObxCvf7m30ridFpBpy.jpeg"
}, {
    "url": "http://laranov.halimtuhu.test/storage/nLkZp4vfpATEp56NStJfeAtKoHvmN2hapfxoNrEN.jpeg",
    "name": "nLkZp4vfpATEp56NStJfeAtKoHvmN2hapfxoNrEN.jpeg"
}]

Available Methods

Disk

Specify disk target for uploaded images.

ArrayImages::make('Images', 'images')
    ->disk('public'),

If not specified then the default disk will be used.

Path

Specify target path for uploaded images.

ArrayImages::make('Images', 'images)
    ->disk('public')
    ->path('images'),

If not specified then default path on selected disk will be used.

Notes

  • make sure you have specified correct APP_URL on your application
  • make sure you have specified default FILESYSTEM_DRIVER on your application

统计信息

  • 总下载量: 39.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 16
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-20