added scope for collection export

This commit is contained in:
Denis Duliçi
2021-06-27 11:40:46 +03:00
parent 0c6dd49902
commit 9b308e165a
23 changed files with 54 additions and 151 deletions

View File

@@ -11,13 +11,7 @@ class Invoices extends Export implements WithColumnFormatting
{
public function collection()
{
$model = Model::invoice()->with('category')->usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);
}
return $model->cursor();
return Model::with('category')->invoice()->collectForExport($this->ids, ['document_number' => 'desc']);
}
public function map($model): array