34 lines
623 B
PHP
Raw Normal View History

2019-11-16 10:21:14 +03:00
<?php
namespace App\Exports\Common;
2020-01-20 02:05:40 +03:00
use App\Abstracts\Export;
2019-11-16 10:21:14 +03:00
use App\Models\Common\Item as Model;
2020-01-20 02:05:40 +03:00
class Items extends Export
2019-11-16 10:21:14 +03:00
{
public function collection()
{
$model = Model::usingSearchString(request('search'));
if (!empty($this->ids)) {
$model->whereIn('id', (array) $this->ids);
}
return $model->get();
}
2020-01-20 02:05:40 +03:00
public function fields(): array
2019-11-16 10:21:14 +03:00
{
return [
'name',
'description',
'sale_price',
'purchase_price',
'category_id',
'tax_id',
'enabled',
];
}
2020-01-20 00:21:37 +03:00
}