如何在不行动的情况下导出NOVA资源以表现出色?
我正在使用Nova和Laravel-Nova-Excel。
我需要导出Cron在磁盘上的Nova-Resource(+添加任何过滤器)的内容,作为Excel。怎么做对的?
现在,我看到此选项:
- 从资源(如何做? - 主要问题)获取查询构建器,
- 如下所述创建一个查询类 - https://docs.laravel-excel.com/3.1/exports/from-query.html
- 导出文件。
有人知道其他选择吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想导出与某个Nova-Resource连接的所有模型,以使其从Cron工作中脱颖而出。如果我误解了您的问题,请纠正我。
laravel-nova-excel
软件包是围绕使用本指南 laravel excel-快速启动定义Excel
exportModel
在其中定义过滤器逻辑的类。创建 laravel命令您触发
exportModel
类。以下工匠命令可用于生成laravel命令:php手工制作:命令exportModel
php工匠命令:导出
You would like to export all the models connected to a certain nova-resource to excel from a cron job. Please correct me if I misinterpreted your question.
Laravel-Nova-Excel
package is a nova wrapper around Laravel Excel. It will be easier to just use the package directly instead of the nova wrapper.Use this guide Laravel Excel - quick start to define a Excel
ExportModel
class in which you define your filter logic.Create a Laravel Command in which you trigger the
ExportModel
class. The following artisan command can be used to generate a laravel command :php artisan make:command ExportModel
php artisan command:export