v2 first commit

This commit is contained in:
denisdulici
2019-11-16 10:21:14 +03:00
parent 5b23e9c2c4
commit 6d50fa8442
3075 changed files with 3451681 additions and 65594 deletions

View File

@@ -0,0 +1,55 @@
<?php
namespace App\Exports\Banking;
use App\Models\Banking\Transaction as Model;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Maatwebsite\Excel\Concerns\WithTitle;
class Transactions implements FromCollection, ShouldAutoSize, WithHeadings, WithMapping, WithTitle
{
public function collection()
{
return Model::usingSearchString(request('search'))->get();
}
public function map($model): array
{
return [
$model->type,
$model->account_id,
$model->paid_at,
$model->amount,
$model->currency_code,
$model->currency_rate,
$model->document_id,
$model->contact_id,
$model->payment_method,
$model->reconciled,
];
}
public function headings(): array
{
return [
'type',
'account_id',
'paid_at',
'amount',
'currency_code',
'currency_rate',
'document_id',
'contact_id',
'payment_method',
'reconciled',
];
}
public function title(): string
{
return 'transactions';
}
}