Files
investbrain/app/Exports/Sheets/DailyChangesSheet.php
T

42 lines
863 B
PHP
Raw Normal View History

2024-08-07 18:29:23 -05:00
<?php
namespace App\Exports\Sheets;
use App\Models\DailyChange;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithTitle;
class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
{
public function headings(): array
{
return [
'Date',
2024-08-28 22:06:47 -05:00
'Portfolio ID',
2024-08-07 18:29:23 -05:00
'Total Market Value',
'Total Cost Basis',
2024-08-28 22:06:47 -05:00
'Total Gain',
2024-08-07 18:29:23 -05:00
'Total Dividends',
'Realized Gains',
2024-08-27 22:06:10 -05:00
'Annotation'
2024-08-07 18:29:23 -05:00
];
}
/**
* @return \Illuminate\Support\Collection
*/
public function collection()
{
2024-08-28 22:06:47 -05:00
return DailyChange::myDailyChanges()->get();
2024-08-07 18:29:23 -05:00
}
/**
* @return string
*/
public function title(): string
{
return 'Daily Changes';
}
}