added histories to prevent n+1

This commit is contained in:
denisdulici 2018-06-21 16:24:40 +03:00
parent 89158e83bd
commit 5a46f86207
2 changed files with 2 additions and 2 deletions

View File

@ -528,7 +528,7 @@ class Bills extends Controller
public function export()
{
\Excel::create('bills', function($excel) {
$bills = Bill::with(['items', 'payments', 'totals'])->filter(request()->input())->get();
$bills = Bill::with(['items', 'histories', 'payments', 'totals'])->filter(request()->input())->get();
$excel->sheet('invoices', function($sheet) use ($bills) {
$sheet->fromModel($bills->makeHidden([

View File

@ -549,7 +549,7 @@ class Invoices extends Controller
public function export()
{
\Excel::create('invoices', function($excel) {
$invoices = Invoice::with(['items', 'payments', 'totals'])->filter(request()->input())->get();
$invoices = Invoice::with(['items', 'histories', 'payments', 'totals'])->filter(request()->input())->get();
$excel->sheet('invoices', function($sheet) use ($invoices) {
$sheet->fromModel($invoices->makeHidden([