akaunting/app/Exports/Sales/Customers.php

41 lines
805 B
PHP
Raw Normal View History

2019-11-16 10:21:14 +03:00
<?php
2019-12-31 15:49:09 +03:00
namespace App\Exports\Sales;
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 Customers extends Export
2019-11-16 10:21:14 +03:00
{
public function collection()
{
2021-06-27 11:40:46 +03:00
return Model::customer()->collectForExport($this->ids);
2019-11-16 10:21:14 +03:00
}
2021-11-08 02:40:40 +03:00
public function map($model): array
{
$model->country = ($model->country) ? trans('countries.' . $model->country) : null;
return parent::map($model);
}
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',
2021-11-08 02:40:40 +03:00
'country',
'state',
'zip_code',
'city',
2019-11-16 10:21:14 +03:00
'website',
'currency_code',
'reference',
'enabled',
];
}
2020-01-20 00:21:37 +03:00
}