CSV/Excel Export Action Error
The chunkById operation was aborted because the [controls.id] column is not present in the query result.
6 Replies
Seems like it's chunking by ID and your data doesn't have an ID?
I have Id in my table
if id fillable?
@Dennis Koch
I really need your help. while exporting the excel with queue it's not working . Please find screen shot .
ExportAction::make()->tooltip('CSV Export (Unexported and Unredeemed)')
->exports([
ExcelExport::make()
->fromTable()->queue()
->except(['redeemed', 'exported'])
->withFilename('couponcodes' . time())
->withWriterType(Excel::CSV)
->withoutHeadings()
->modifyQueryUsing(fn($query) => $query->where('exported', false)->where('redeemed', false))
])
->before(function (Actions\Action $action, CouponCode $couponCode) {
$couponCodes = $couponCode->where('exported', false)->where('redeemed', false)->pluck('id')->toArray();
if (empty($couponCodes)) {
Notification::make()
->info()
->title('Oops! There is no coupon codes available to export.')
->send();
$action->cancel();
}
})
Not sure why you post this here and tag me? The post is unrelated to your question, there are plugin channels for each plugin ( #pxlrbt-excel ) and you shouldn't tag people ( #✅┊rules )
I am extremely sorry for this . I don't about it . I will re-post this question in the #pxlrbt-excel channels.