2019-11-16 10:21:14 +03:00
|
|
|
<?php
|
|
|
|
|
2019-12-31 15:49:09 +03:00
|
|
|
namespace App\Exports\Purchases;
|
2019-11-16 10:21:14 +03:00
|
|
|
|
2020-01-20 02:05:40 +03:00
|
|
|
use App\Abstracts\Export;
|
2019-11-16 10:21:14 +03:00
|
|
|
use App\Models\Common\Contact as Model;
|
|
|
|
|
2020-01-20 02:05:40 +03:00
|
|
|
class Vendors extends Export
|
2019-11-16 10:21:14 +03:00
|
|
|
{
|
|
|
|
public function collection()
|
|
|
|
{
|
|
|
|
$model = Model::type('vendor')->usingSearchString(request('search'));
|
|
|
|
|
|
|
|
if (!empty($this->ids)) {
|
|
|
|
$model->whereIn('id', (array) $this->ids);
|
|
|
|
}
|
|
|
|
|
2020-03-02 23:13:36 +03:00
|
|
|
return $model->cursor();
|
2019-11-16 10:21:14 +03:00
|
|
|
}
|
|
|
|
|
2020-01-20 02:05:40 +03:00
|
|
|
public function fields(): array
|
2019-11-16 10:21:14 +03:00
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name',
|
|
|
|
'email',
|
|
|
|
'tax_number',
|
|
|
|
'phone',
|
|
|
|
'address',
|
|
|
|
'website',
|
|
|
|
'currency_code',
|
|
|
|
'reference',
|
|
|
|
'enabled',
|
2020-01-20 00:21:37 +03:00
|
|
|
'user_id',
|
2019-11-16 10:21:14 +03:00
|
|
|
];
|
|
|
|
}
|
2020-01-20 00:21:37 +03:00
|
|
|
}
|