定制 ferdiunal/laravel-nova-media-field 二次开发

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

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

ferdiunal/laravel-nova-media-field

最新稳定版本:v1.0.7

Composer 安装命令:

composer require ferdiunal/laravel-nova-media-field

包简介

A Laravel Nova media field for Spatie's media library

README 文档

README

Laravel Nova Media Field is a component designed to integrate seamlessly with Spatie's Media Library, allowing for efficient media file management within Laravel Nova. This package makes it easy to upload, list, and edit media files directly from your Nova dashboard.

Features:

  • Easy media file upload
  • Previews and edits
  • Comprehensive media management

This component enhances the media management experience in Nova, offering a simple yet customizable solution for developers.

Install

composer require ferdiunal/laravel-nova-media-field

Usage

/**
 * Get the fields displayed by the resource.
 *
 * @return array
 */
public function fields(NovaRequest $request)
{
    return [
        ID::make()->sortable(),
        MediaField::make('Logo', 'logo')
          ->required()
          ->multiple()
          ->vapor()
          ->withResponsive()
          ->validate(
                minSize: 30, // The allowed extensions for the file.
                maxSize: 1024 * 50, // The allowed mime types for the file.
                size: 1024 * 50, // The minimum size of the file.
                image: false, // The maximum size of the file.
                video: false, // The size of the file.
                audio: false, // Whether to allow only image files.
                document: false, // Whether to allow only video files.
                pdf: false, // Whether to allow only audio files.
                txt: false, // Whether to allow only document files.
                json: false, // Whether to allow only PDF files.
                csv: false, // Whether to allow only text files.
                xlsx: false, // Whether to allow only JSON files.
                docx: false, // Whether to allow only CSV files.
                creation: false, // Whether to allow only XLSX files.
                update: false, // Whether to allow only DOCX files.
                default: false, // Whether to apply the rules for creation.
                allowedExtensions: [], // Whether to apply the rules for update.
                allowedMimeTypes: [] // Whether to apply the rules as default.
            )
    ];
}

Screenshots

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-27