dzorogh / nova-card-data-update

一个通用的Laravel Nova卡片,用于使用Excel文件更新数据。

1.1.1 2022-02-21 14:49 UTC

This package is auto-updated.

Last update: 2024-09-23 15:20:41 UTC


README

image

Laravel Nova的有用卡片,当您需要具有大量批量更新操作的数据编辑界面时。在这种情况下,导入/导出xlsx文件是一个不错的选择。此卡片提供了两个简单操作

  1. 运行Excel导出脚本并下载文件
  2. 上传文件并运行导入文件

安装

composer require dzorogh/nova-card-excel-data-update

此外,您还必须安装来自流行包Laravel Excel的导入和导出功能

composer require maatwebsite/excel

更多文档:https://docs.laravel-excel.com/3.1/getting-started/installation.html

用法

它可以在Laravel Nova的任何位置使用,任何其他卡片都可以使用。

例如,在app/Nova/NovaServiceProvider.php中显示卡片在仪表板上

    use Dzorogh\ExcelDataUpdate\ExcelDataUpdate;
    
    /**
     * Get the cards that should be displayed on the default Nova dashboard.
     *
     * @return array
     */
    protected function cards()
    {
        return [
            new ExcelDataUpdate(new ExportClass, new ImportClass)
        ];
    }

ExportClass和ImportClass在此处描述:https://docs.laravel-excel.com/

待办事项

  • 英文翻译
  • 上传结果
  • 上传和编辑的百分比
  • 如何使用队列的说明
  • 导出/导入错误