salekur / nova-report-generator
一个Laravel Nova报表生成工具。
v0.0.2
2023-10-01 12:00 UTC
Requires
- php: ^7.3|^8.0
- barryvdh/laravel-dompdf: *
- laravel/framework: ^8.0|^9.0|^10.0
- laravel/nova: ^4.0
This package is auto-updated.
Last update: 2024-09-30 01:47:21 UTC
README
这是一个Laravel Nova报表生成工具,可以针对任何模型生成报表,支持选择列。它还可以以CSV和PDF格式导出数据。它还提供了日期范围筛选选项,并具有对任何列求和的功能。这是一个非常简单的工具,可用于生成任何Laravel项目中使用Laravel Nova的任何模型的报表。
依赖
安装
composer require salekur/nova-report-generator
兼容性
我测试了以下依赖版本。
发布配置
使用以下命令发布配置文件:
php artisan vendor:publish --tag=reporter-config --provider=Salekur\NovaReportGenerator\ToolServiceProvider
发布视图(可选)
如果您想自定义视图,可以发布视图文件。使用以下命令发布视图文件:
php artisan vendor:publish --tag=reporter-views --provider=Salekur\NovaReportGenerator\ToolServiceProvider
默认配置
<?php return [ /** * Name of the tool. * * This name will be displayed in the navigation bar and on the tool's index page. * */ 'name' => 'Reporter', /** * Path for the tool. * * This path will be used for building the url to the tool. * */ 'path' => 'reporter', /** * Icon name of the tool. * * This icon will be displayed on the navigation bar. * Icons list can be found at https://heroicons.com * */ 'icon' => 'document-text', /** * Tool's visibility. * * This option determines whether the tool will be displayed in the navigation bar or not. * */ 'visible' => true, /** * Export options. * * Options for exporting data. * */ 'export' => [ /** * Name of the export file. * * This name will be used for generating the file. * */ // 'name' => 'export', /** * Channels for exporting data. * * This option determines which channels will be available for exporting data. * */ 'channels' => [ 'csv' => true, 'pdf' => true ], /** * PDF options. * * Options for generating PDF. * */ 'config' => [ 'format' => 'A4', 'orientation' => 'landscape', 'header' => [ // 'image' => public_path('images/logo.png'), 'title' => 'Invoice' ] ] ], /** * Models for the tool. * * This option determines which models will be available for generating reports. * */ 'models' => [ 'user' => [ 'name', 'email', 'created_at' => [ // label for the column 'label' => 'Date', // if you want to use period filter then set 'period' to true 'period' => true ] ], 'order' => [ 'number', 'status', 'price' => [ // if you want to use sum of number column then set 'summable' to true 'summable' => true ], 'created_at' => [ // label for the column 'label' => 'Date', // if you want to use period filter then set 'period' to true 'period' => true ] ], ] ];
问题
- 对关系字段的支待尚未完成。
- 如果您还有其他问题,请通过以下链接告诉我:问题