laravel - 如何在 laravel 中使用 cron 作业在 localpath 中存储 excel 文件?
问题描述
我正在使用 Laravel 5.7 和 Windows 调度程序进行 cron 作业。我想使用 cron 作业存储 excel 文件。我怎样才能做到这一点?
我用过Excel::store()
方法。但它只有在我点击按钮时才有效。如何使用 cron 作业来实现这一点?
我尝试使用此代码:
protected $signature = 'excel:attendance';
protected $description = 'Using smart office excel for attendance';
public function __construct()
{
parent::__construct();
}
public function handle()
{
Excel::store(new attendanceExcel(),'Dummy_excel_cronjob.xlsx');
}
但这不起作用。
解决方案
推荐阅读
- python - 当数据通过回调可用时,如何更新 Bokeh 服务器?
- android - Gradle 任务在不调用的情况下启动
- python - XON/XOFF 流控制实际上是做什么的?
- python-3.x - 找不到满足要求搜索的版本(来自版本:)没有找到匹配的分布进行搜索
- mysql - 用于选择产品的 sql 查询的动态过滤器
- excel - VBA - 点击取消的第二次以上迭代不会留下空单元格
- scala - 如何在akka http中传递Json内容类型
- mapbox-gl-js - GeoJSON nested objects Mapbox GL JS
- node.js - 尝试运行friendly-pix web(firebase 示例项目)但没有成功| 函数预部署错误:命令以非零退出代码1终止
- php - unable to auto increment in foreach key as value