added histories to prevent n+1
This commit is contained in:
parent
89158e83bd
commit
5a46f86207
@ -528,7 +528,7 @@ class Bills extends Controller
|
|||||||
public function export()
|
public function export()
|
||||||
{
|
{
|
||||||
\Excel::create('bills', function($excel) {
|
\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) {
|
$excel->sheet('invoices', function($sheet) use ($bills) {
|
||||||
$sheet->fromModel($bills->makeHidden([
|
$sheet->fromModel($bills->makeHidden([
|
||||||
|
@ -549,7 +549,7 @@ class Invoices extends Controller
|
|||||||
public function export()
|
public function export()
|
||||||
{
|
{
|
||||||
\Excel::create('invoices', function($excel) {
|
\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) {
|
$excel->sheet('invoices', function($sheet) use ($invoices) {
|
||||||
$sheet->fromModel($invoices->makeHidden([
|
$sheet->fromModel($invoices->makeHidden([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user