如何在不行动的情况下导出NOVA资源以表现出色?

发布于 2025-01-22 01:56:04 字数 412 浏览 5 评论 0 原文

我正在使用Nova和Laravel-Nova-Excel。

我需要导出Cron在磁盘上的Nova-Resource(+添加任何过滤器)的内容,作为Excel。怎么做对的?

现在,我看到此选项:

  1. 从资源(如何做? - 主要问题)获取查询构建器,
  2. 如下所述创建一个查询类 - https://docs.laravel-excel.com/3.1/exports/from-query.html
  3. 导出文件。

有人知道其他选择吗?

I am using Nova and Laravel-Nova-Excel.

I need to export the contents of a nova-resource (+ add any filters) by cron on disk, as Excel. How to do it right?

Now I see this option:

  1. Get the query builder from the resource (how to do it? - the main problem)
  2. Create a query class as described here - https://docs.laravel-excel.com/3.1/exports/from-query.html
  3. Export the file.

Does anyone know other options?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

友欢 2025-01-29 01:56:04

您想导出与某个Nova-Resource连接的所有模型,以使其从Cron工作中脱颖而出。如果我误解了您的问题,请纠正我。

laravel-nova-excel 软件包是围绕

  • 使用本指南 laravel excel-快速启动定义Excel exportModel 在其中定义过滤器逻辑的类。

  • 创建 laravel命令您触发 exportModel 类。以下工匠命令可用于生成laravel命令: php手工制作:命令exportModel

    • 在您现有的cronjob中使用此命令: php工匠命令:导出
    • 或使用内置的laravel计划 laravel Schedules li>

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

    • Use this command in your existing cronjob: php artisan command:export
    • Or use the built in laravel schedules laravel schedules
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文