stepanenko3/nova-media-field 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

stepanenko3/nova-media-field

最新稳定版本:v3.0.1

Composer 安装命令:

composer require stepanenko3/nova-media-field

包简介

A Laravel Nova field for laravel-medilibrary.

README 文档

README

Latest Version on Packagist Total Downloads License

screenshot of field

Description

A Laravel Nova field for laravel-medilibrary.

Features

  • Multiple / Single image support
  • Multiple images auto-detect based on collection
  • Display validation errors
  • Show on index multiple images
  • Modal with media details
  • Show all conversions
  • Open / Download / Copy URL of media
  • Regenerate image with conversions
  • Custom properties support

Requirements

  • php: >=8.0
  • laravel/nova: ^4.0
  • spatie/laravel-medilibrary: ^11.4

Installation

# Install the package
composer require stepanenko3/nova-media-field

Usage

use use Stepanenko3\NovaMediaField\Fields\Media;
...

Media::make(__('Image'), 'image'), // Single image. Auto detect from collection

Media::make(__('Images'), 'images'), // Multiple images. Auto detect from collection

// Validation rules

Media::make('Images', 'images')
    ->rules(['required', 'array', 'max:4'])
    ->singleMediaRules(['image', 'max:80']),


// Custom properties with validtion

Media::make('Images', 'images')
    ->customPropertiesFields([
        Boolean::make('Active', 'active')
            ->rules(['boolean']),

        Markdown::make('Description', 'description')
            ->rules(['max:1000']),
    ])


// Count images displayed on index

Media::make('Images', 'images')
    ->countOfImagesDisplayedOnIndex(2),


// Full example

Media::make('Images', 'images')
    ->customPropertiesFields([
        Boolean::make('Active', 'active')
            ->rules(['boolean']),

        Markdown::make('Description', 'description')
            ->rules(['max:1000']),
    ])
    ->countOfImagesDisplayedOnIndex(2)
    ->rules(['required', 'array', 'max:4'])
    ->singleMediaRules(['image', 'max:80']),

Usage with File Manager

Install stepanenko3/nova-filemanager

compore require stepanenko3/nova-filemanager

Register Service provider

// app/Providers/NovaServiceProvider.php

public function tools(): array
{
    return [
        new Stepanenko3\NovaFileManager\FileManagerTool,
    ];
}

Use Media field with File Manager

Media::make(__('Image'), 'image')
    ->fileManager(),

Screenshots

screenshot of field screenshot of field screenshot of field screenshot of field screenshot of field screenshot of field

Credits

Contributing

Thank you for considering contributing to this package! Please create a pull request with your contributions with detailed explanation of the changes you are proposing.

License

This package is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 17
  • Watchers: 1
  • Forks: 6
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固