adds company scoping to license export

This commit is contained in:
Godfrey M 2024-04-22 10:38:55 -07:00
parent 420225c2d5
commit 25f1167c9d

View file

@ -308,8 +308,13 @@ class LicensesController extends Controller
// Open output stream // Open output stream
$handle = fopen('php://output', 'w'); $handle = fopen('php://output', 'w');
License::with('company','manufacturer','category', 'supplier', 'adminuser') $licenses= License::with('company',
->orderBy('created_at', 'DESC') 'manufacturer',
'category',
'supplier',
'adminuser')
->orderBy('created_at', 'DESC');
Company::scopeCompanyables($licenses)
->chunk(500, function ($licenses) use ($handle) { ->chunk(500, function ($licenses) use ($handle) {
$headers = [ $headers = [
// strtolower to prevent Excel from trying to open it as a SYLK file // strtolower to prevent Excel from trying to open it as a SYLK file