From 5cd396f1232f3fb0f8d8c0b2f9ff02b72f9a1d7d Mon Sep 17 00:00:00 2001 From: denisdulici Date: Mon, 2 Mar 2020 23:13:36 +0300 Subject: [PATCH] lazy collections for exports --- app/Exports/Banking/Transactions.php | 2 +- app/Exports/Common/Items.php | 2 +- app/Exports/Purchases/Payments.php | 2 +- app/Exports/Purchases/Sheets/BillHistories.php | 2 +- app/Exports/Purchases/Sheets/BillItemTaxes.php | 2 +- app/Exports/Purchases/Sheets/BillItems.php | 2 +- app/Exports/Purchases/Sheets/BillTotals.php | 2 +- app/Exports/Purchases/Sheets/BillTransactions.php | 2 +- app/Exports/Purchases/Sheets/Bills.php | 2 +- app/Exports/Purchases/Vendors.php | 2 +- app/Exports/Sales/Customers.php | 2 +- app/Exports/Sales/Revenues.php | 2 +- app/Exports/Sales/Sheets/InvoiceHistories.php | 2 +- app/Exports/Sales/Sheets/InvoiceItemTaxes.php | 2 +- app/Exports/Sales/Sheets/InvoiceItems.php | 2 +- app/Exports/Sales/Sheets/InvoiceTotals.php | 2 +- app/Exports/Sales/Sheets/InvoiceTransactions.php | 2 +- app/Exports/Sales/Sheets/Invoices.php | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/Exports/Banking/Transactions.php b/app/Exports/Banking/Transactions.php index f153d8a0f..5a90bcaba 100644 --- a/app/Exports/Banking/Transactions.php +++ b/app/Exports/Banking/Transactions.php @@ -15,7 +15,7 @@ class Transactions extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Common/Items.php b/app/Exports/Common/Items.php index 22c2aee92..a42d103e4 100644 --- a/app/Exports/Common/Items.php +++ b/app/Exports/Common/Items.php @@ -15,7 +15,7 @@ class Items extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Payments.php b/app/Exports/Purchases/Payments.php index 731a8969b..4a903ad17 100644 --- a/app/Exports/Purchases/Payments.php +++ b/app/Exports/Purchases/Payments.php @@ -15,7 +15,7 @@ class Payments extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Sheets/BillHistories.php b/app/Exports/Purchases/Sheets/BillHistories.php index 07746ea23..ce8f3f849 100644 --- a/app/Exports/Purchases/Sheets/BillHistories.php +++ b/app/Exports/Purchases/Sheets/BillHistories.php @@ -15,7 +15,7 @@ class BillHistories extends Export $model->whereIn('bill_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Sheets/BillItemTaxes.php b/app/Exports/Purchases/Sheets/BillItemTaxes.php index 41977af0b..8c28a1606 100644 --- a/app/Exports/Purchases/Sheets/BillItemTaxes.php +++ b/app/Exports/Purchases/Sheets/BillItemTaxes.php @@ -15,7 +15,7 @@ class BillItemTaxes extends Export $model->whereIn('bill_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Sheets/BillItems.php b/app/Exports/Purchases/Sheets/BillItems.php index ba83c2871..d03370d80 100644 --- a/app/Exports/Purchases/Sheets/BillItems.php +++ b/app/Exports/Purchases/Sheets/BillItems.php @@ -15,7 +15,7 @@ class BillItems extends Export $model->whereIn('bill_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Sheets/BillTotals.php b/app/Exports/Purchases/Sheets/BillTotals.php index 3846285dd..b172a7b73 100644 --- a/app/Exports/Purchases/Sheets/BillTotals.php +++ b/app/Exports/Purchases/Sheets/BillTotals.php @@ -15,7 +15,7 @@ class BillTotals extends Export $model->whereIn('bill_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Sheets/BillTransactions.php b/app/Exports/Purchases/Sheets/BillTransactions.php index 8d5069ee7..be3eb613e 100644 --- a/app/Exports/Purchases/Sheets/BillTransactions.php +++ b/app/Exports/Purchases/Sheets/BillTransactions.php @@ -15,7 +15,7 @@ class BillTransactions extends Export $model->whereIn('document_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Sheets/Bills.php b/app/Exports/Purchases/Sheets/Bills.php index 2cf71415e..6d911fef3 100644 --- a/app/Exports/Purchases/Sheets/Bills.php +++ b/app/Exports/Purchases/Sheets/Bills.php @@ -15,7 +15,7 @@ class Bills extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Purchases/Vendors.php b/app/Exports/Purchases/Vendors.php index 061c24503..8ebfd1c91 100644 --- a/app/Exports/Purchases/Vendors.php +++ b/app/Exports/Purchases/Vendors.php @@ -15,7 +15,7 @@ class Vendors extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function fields(): array diff --git a/app/Exports/Sales/Customers.php b/app/Exports/Sales/Customers.php index 90defda81..9ae1d2a1e 100644 --- a/app/Exports/Sales/Customers.php +++ b/app/Exports/Sales/Customers.php @@ -15,7 +15,7 @@ class Customers extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function fields(): array diff --git a/app/Exports/Sales/Revenues.php b/app/Exports/Sales/Revenues.php index 34e803906..47f9f384f 100644 --- a/app/Exports/Sales/Revenues.php +++ b/app/Exports/Sales/Revenues.php @@ -15,7 +15,7 @@ class Revenues extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Sales/Sheets/InvoiceHistories.php b/app/Exports/Sales/Sheets/InvoiceHistories.php index 2af6e260f..47c6186d5 100644 --- a/app/Exports/Sales/Sheets/InvoiceHistories.php +++ b/app/Exports/Sales/Sheets/InvoiceHistories.php @@ -15,7 +15,7 @@ class InvoiceHistories extends Export $model->whereIn('invoice_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Sales/Sheets/InvoiceItemTaxes.php b/app/Exports/Sales/Sheets/InvoiceItemTaxes.php index 1a128ac2d..99aac016d 100644 --- a/app/Exports/Sales/Sheets/InvoiceItemTaxes.php +++ b/app/Exports/Sales/Sheets/InvoiceItemTaxes.php @@ -15,7 +15,7 @@ class InvoiceItemTaxes extends Export $model->whereIn('invoice_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Sales/Sheets/InvoiceItems.php b/app/Exports/Sales/Sheets/InvoiceItems.php index e65dbdcca..1379c704b 100644 --- a/app/Exports/Sales/Sheets/InvoiceItems.php +++ b/app/Exports/Sales/Sheets/InvoiceItems.php @@ -15,7 +15,7 @@ class InvoiceItems extends Export $model->whereIn('invoice_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Sales/Sheets/InvoiceTotals.php b/app/Exports/Sales/Sheets/InvoiceTotals.php index 9953d206f..c640b144a 100644 --- a/app/Exports/Sales/Sheets/InvoiceTotals.php +++ b/app/Exports/Sales/Sheets/InvoiceTotals.php @@ -15,7 +15,7 @@ class InvoiceTotals extends Export $model->whereIn('invoice_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Sales/Sheets/InvoiceTransactions.php b/app/Exports/Sales/Sheets/InvoiceTransactions.php index 36d058b39..cdb3ab71c 100644 --- a/app/Exports/Sales/Sheets/InvoiceTransactions.php +++ b/app/Exports/Sales/Sheets/InvoiceTransactions.php @@ -15,7 +15,7 @@ class InvoiceTransactions extends Export $model->whereIn('document_id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array diff --git a/app/Exports/Sales/Sheets/Invoices.php b/app/Exports/Sales/Sheets/Invoices.php index 653611742..20ad0c4d3 100644 --- a/app/Exports/Sales/Sheets/Invoices.php +++ b/app/Exports/Sales/Sheets/Invoices.php @@ -15,7 +15,7 @@ class Invoices extends Export $model->whereIn('id', (array) $this->ids); } - return $model->get(); + return $model->cursor(); } public function map($model): array