承接 alberto-bottarini/nova-image-with-thumbs 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

alberto-bottarini/nova-image-with-thumbs

最新稳定版本:v1.1.1

Composer 安装命令:

composer require alberto-bottarini/nova-image-with-thumbs

包简介

A Laravel Nova field.

README 文档

README

This custom fields add thumbnail ability to standard Image Field in Laravel Nova.

Take a look at this example:

NovaImageWithThumbs::make('Image', 'image')
    ->thumbs([
        ['name' => 'thumbnail', 'w' => 200, 'h' => 100, 'method' => 'fit'],
    ])
    ->disk('public')
    ->path('images-from-nova')
    ->prunable()
    ->hideFromIndex(),

This field will automatically generate two images on your disk and will fill image and thumbnail attribute of your model with path of these files. Using $model->image you will find original uploaded image and with $model->thumbnail you will find a 200x100 image.

Configuration

thumbs method accepts a list of associatable-array with these keys:

Key Mandatory Acceptance Description
name Y string The model column where you want to persist your thumbnail path
w Y integer The width of thumbnail
h Y integer The height of thumbnail
method Y string (fit/resize) The Intervention method to generate image

Prunable

NovaImageWithThumbs takes care of prunable images. If you delete a model with thumbnails, the field will automatically deletes useless files for you.

Show thumbnails to users

If you need to show thumbnails inside index or detail page, you can add a new standard Image Field to your resource:

Image::make('Thumbnail', 'thumbnail')
    ->disk('public')
    ->path('images-from-nova')
    ->exceptOnForms()

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-29