chore: code style
This commit is contained in:
@@ -14,18 +14,14 @@ class BackupExport implements WithMultipleSheets
|
||||
|
||||
public function __construct(
|
||||
public bool $empty = false
|
||||
)
|
||||
{ }
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function sheets(): array
|
||||
{
|
||||
return [
|
||||
new PortfoliosSheet($this->empty),
|
||||
new TransactionsSheet($this->empty),
|
||||
new DailyChangesSheet($this->empty)
|
||||
];
|
||||
return [
|
||||
new PortfoliosSheet($this->empty),
|
||||
new TransactionsSheet($this->empty),
|
||||
new DailyChangesSheet($this->empty),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
public function __construct(
|
||||
public bool $empty = false
|
||||
) { }
|
||||
) {}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
@@ -23,21 +23,18 @@ class DailyChangesSheet implements FromCollection, WithHeadings, WithTitle
|
||||
'Total Gain',
|
||||
'Total Dividends Earned',
|
||||
'Realized Gains',
|
||||
'Annotation'
|
||||
'Annotation',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return $this->empty ? collect() : DailyChange::myDailyChanges()->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return 'Daily Changes';
|
||||
|
||||
@@ -11,8 +11,8 @@ class PortfoliosSheet implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
public function __construct(
|
||||
public bool $empty = false
|
||||
) { }
|
||||
|
||||
) {}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
return [
|
||||
@@ -21,21 +21,18 @@ class PortfoliosSheet implements FromCollection, WithHeadings, WithTitle
|
||||
'Notes',
|
||||
'Wishlist',
|
||||
'Created',
|
||||
'Updated'
|
||||
'Updated',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return $this->empty ? collect() : Portfolio::myPortfolios()->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return 'Portfolios';
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
namespace App\Exports\Sheets;
|
||||
|
||||
use App\Models\Transaction;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
use Maatwebsite\Excel\Concerns\WithTitle;
|
||||
|
||||
class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
{
|
||||
public function __construct(
|
||||
public bool $empty = false
|
||||
) { }
|
||||
) {}
|
||||
|
||||
public function headings(): array
|
||||
{
|
||||
@@ -27,21 +27,18 @@ class TransactionsSheet implements FromCollection, WithHeadings, WithTitle
|
||||
'Reinvested Dividend',
|
||||
'Date',
|
||||
'Created',
|
||||
'Updated'
|
||||
'Updated',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return $this->empty ? collect() : Transaction::myTransactions()->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function title(): string
|
||||
{
|
||||
return 'Transactions';
|
||||
|
||||
Reference in New Issue
Block a user