From fc07753a5c1207cadeaf32d7166df68d1425a80b Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 28 Sep 2016 19:18:01 -0700 Subject: [PATCH] Use $customfields in closure --- app/Http/Controllers/ReportsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index f39a8a66c5..dcc93e0341 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -117,11 +117,11 @@ class ReportsController extends Controller $customfields = CustomField::get(); - $response = new StreamedResponse(function(){ + $response = new StreamedResponse(function() use ($customfields) { // Open output stream $handle = fopen('php://output', 'w'); - Asset::with('assigneduser', 'assetloc','defaultLoc','assigneduser.userloc','model','supplier','assetstatus','model.manufacturer')->orderBy('created_at', 'DESC')->chunk(500, function($assets) use($handle) { + Asset::with('assigneduser', 'assetloc','defaultLoc','assigneduser.userloc','model','supplier','assetstatus','model.manufacturer')->orderBy('created_at', 'DESC')->chunk(500, function($assets) use($handle, $customfields) { $headers=[ trans('general.company'), trans('admin/hardware/table.asset_tag'),