wip
including working export button
This commit is contained in:
@@ -3,9 +3,6 @@
|
||||
namespace App\Exports;
|
||||
|
||||
use App\Exports\Sheets\DailyChangesSheet;
|
||||
use App\Exports\Sheets\SplitsSheet;
|
||||
use App\Exports\Sheets\DividendsSheet;
|
||||
use App\Exports\Sheets\MarketDataSheet;
|
||||
use App\Exports\Sheets\PortfoliosSheet;
|
||||
use App\Exports\Sheets\TransactionsSheet;
|
||||
use Maatwebsite\Excel\Concerns\Exportable;
|
||||
@@ -23,9 +20,6 @@ class BackupExport implements WithMultipleSheets
|
||||
return [
|
||||
new PortfoliosSheet,
|
||||
new TransactionsSheet,
|
||||
new MarketDataSheet,
|
||||
new DividendsSheet,
|
||||
new SplitsSheet,
|
||||
new DailyChangesSheet
|
||||
];
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@ class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
return [
|
||||
'Date',
|
||||
'User',
|
||||
'Portfolio',
|
||||
'Total Market Value',
|
||||
'Total Cost Basis',
|
||||
'Total Gain Loss',
|
||||
'Total Dividends',
|
||||
'Realized Gains',
|
||||
'Notes'
|
||||
'Annotation'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return DailyChange::myDailyChanges()->get();
|
||||
return auth()->user()->daily_changes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\Sheets;
|
||||
|
||||
use App\Models\Dividend;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
|
||||
class DividendsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Date',
|
||||
'Symbol',
|
||||
'Amount',
|
||||
'Created',
|
||||
'Updated',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return Dividend::get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return 'Dividends';
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\Sheets;
|
||||
|
||||
use App\Models\MarketData;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
|
||||
class MarketDataSheet implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'Symbol',
|
||||
'Name',
|
||||
'Market Value',
|
||||
'52 Week Low',
|
||||
'52 Week High',
|
||||
'Dividend Date',
|
||||
'Splits Synced To Holdings At',
|
||||
'Created',
|
||||
'Updated',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return MarketData::get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return 'Market Data';
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ class PortfoliosSheet implements FromCollection, WithHeadings, WithTitle
|
||||
'Notes',
|
||||
'Wishlist',
|
||||
'Created',
|
||||
'Updated',
|
||||
'Updated'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class PortfoliosSheet implements FromCollection, WithHeadings, WithTitle
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return Portfolio::myPortfolios()->get();
|
||||
return auth()->user()->portfolios;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exports\Sheets;
|
||||
|
||||
use App\Models\Split;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
|
||||
class SplitsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Date',
|
||||
'Symbol',
|
||||
'Split',
|
||||
'Created',
|
||||
'Updated',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return Split::get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return 'Splits';
|
||||
}
|
||||
}
|
||||
@@ -12,10 +12,10 @@ class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
'ID',
|
||||
'Transaction ID',
|
||||
'Symbol',
|
||||
'Portfolio',
|
||||
'Transaction',
|
||||
'Portfolio ID',
|
||||
'Transaction Type',
|
||||
'Quantity',
|
||||
'Cost Basis',
|
||||
'Sale Price',
|
||||
@@ -23,6 +23,14 @@ class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
'Date',
|
||||
'Created',
|
||||
'Updated',
|
||||
'Company Name',
|
||||
'Portfolio Title',
|
||||
'Market Value',
|
||||
'52 Week Low',
|
||||
'52 Week High',
|
||||
'Market Data Refresh Date',
|
||||
'Gain/Loss Dollars',
|
||||
'Owner ID'
|
||||
];
|
||||
}
|
||||
|
||||
@@ -31,7 +39,7 @@ class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return Transaction::myTransactions()->get();
|
||||
return auth()->user()->transactions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user